ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Barlow" <garybar...@hotmail.com>
Subject Cache issue using discriminator
Date Mon, 31 Oct 2005 14:30:15 GMT
I'm using a serialized cache with result maps that contain a discriminator. 
This fails with NotSerializableException unless I set 
lazyLoadingEnabled="false". Is this expected?

What effect does setting lazyLoadingEnabled=false have?

Error msg is:
com.ibatis.common.exception.NestedRuntimeException: Error caching 
serializable object.  Cause: java.io.NotSerializableException: 
com.ibatis.sqlmap.engine.mapping.result.loader.LazyResultLoader
Caused by: java.io.NotSerializableException: 
com.ibatis.sqlmap.engine.mapping.result.loader.LazyResultLoader

SQLMap:
<sqlMap namespace="Dimension">

   <cacheModel id="dimensionGroupCache" type="LRU" readOnly="false" 
serialize="true">
       <flushInterval hours="10"/>
       <property name="size" value="1000"/>
       <flushOnExecute statement="deleteGroup"/>
       <flushOnExecute statement="updateDimensionGroup"/>
   </cacheModel>

   <resultMap id="dimensionGroupAbstractResult" 
class="com.manu.tro.service.dimension.model.DimensionGroupAbstract">
       <result property="id" column="DIM_GROUP_ID"/>
       <result property="name" column="NAME"/>
       <result property="dimensionId" column="DIMENSION_ID"/>
       <discriminator column="TYPE" javaType="string">
           <subMap value="Group" resultMap="dimensionGroupResult"/>
           <subMap value="Range" resultMap="dimensionGroupRangeResult"/>
       </discriminator>
   </resultMap>

   <resultMap id="dimensionGroupResult" 
class="com.manu.tro.service.dimension.model.DimensionGroup" 
extends="dimensionGroupAbstractResult">
       <result property="dimensionGroupValues" column="DIM_GROUP_ID" 
select="getDimensionGroupValues"/>
   </resultMap>

   <resultMap id="dimensionGroupRangeResult" 
class="com.manu.tro.service.dimension.model.DimensionGroupRange" 
extends="dimensionGroupAbstractResult">
       <result property="from" column="FROM_VALUE"/>
       <result property="to" column="TO_VALUE"/>
   </resultMap>

   <select id="getDimensionGroup" resultMap="dimensionGroupAbstractResult" 
cacheModel="dimensionGroupCache">
   sql..................



Mime
View raw message