Question

I have the map config file like this

<sqlMap ..............>

    <alias>
      <typeAlias ......../>
    </alias>

    <statements>
      ....
      <sql>....</sql>
      <select cacheModel="cache-select-all">....</select>
      <update>...</update>
      <procedure>...</procedure>
      .....
    </statements>    

    <parameterMaps>
      <parameterMap>....</parameterMap>
    </parameterMaps>

    <cacheModel id="cache-select-all" type="LRU" readOnly="true" serialize="false">
      <flushInterval hours="24"/>
      <flushOnExecute statement="InsertIOs"/>
      <!--<property name="CacheSize" value="1000"/>-->
    </cacheModel>

  </sqlMap>

I am using ibatis (.net, if that matters) and i have one question: where to place the tags? is There a or because placing it like i did, in the statements seems not to work. What am i doing wrong?

Was it helpful?

Solution

You must reference the cacheModel you defined inside a statement tag as shown in the following link:

http://ibatis.apache.org/docs/dotnet/datamapper/ch03s08.html

OTHER TIPS

Before you use it in the select statement. Order does matter here. Otherwise sql map parser wouldn't be able to validate your sql map.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top