Hi,
I have a very weird problem with the ObjectCacheTwoLevelImpl cache.
I'm using two environments:
Jboss 4.0.1 for development and BEA WebLogic 8.1sp4 for production.
The class descriptors are the following:
<class-descriptor class="Action" table="ACTION" isolation-level =
"read-uncommitted" >
<field-descriptor id="1" name="id" column="ACTION_ID"
jdbc-type="INTEGER" primarykey="true"/>
<field-descriptor id="2" name="actionTypeId" column="ACTION_TP_ID"
jdbc-type="INTEGER" primarykey="false"/>
<field-descriptor id="5" name="title" column="TITLE"
jdbc-type="VARCHAR" primarykey="false"/>
<reference-descriptor name="envelope" class-ref="Envelope"
proxy="true"
auto-retrieve="true" auto-update="link"
auto-delete="false" >
<foreignkey field-ref="id"/>
</reference-descriptor>
</class-descriptor>
<class-descriptor class="Envelope" table="ENVELOPE" isolation-level =
"read-uncommitted">
<field-descriptor id="1" name="actionId" column="action_id"
jdbc-type="INTEGER" primarykey="true"/>
<field-descriptor id="3" name="totalAmount" column="total_amnt"
jdbc-type="DECIMAL" primarykey="false" />
<field-descriptor id="4" name="startDate" column="start_dt"
jdbc-type="TIMESTAMP" primarykey="false"/>
<field-descriptor id="5" name="endDate" column="end_dt"
jdbc-type="TIMESTAMP" primarykey="false"/>
</class-descriptor>
All the classes are cached at jdbc-connection-descriptor level using :
<object-cache
class="org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl">
<attribute attribute-name="cacheExcludes" attribute-value=""/>
<attribute attribute-name="applicationCache"
attribute-value="org.apache.ojb.broker.cache.ObjectCacheDefaultImpl"/>
<attribute attribute-name="copyStrategy"
attribute-value="org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl$CopyStr
ategyImpl"/>
<attribute attribute-name="timeout" attribute-value="9000"/>
<attribute attribute-name="autoSync" attribute-value="true"/>
<attribute attribute-name="cachingKeyType" attribute-value="0"/>
<attribute attribute-name="useSoftReferences"
attribute-value="true"/>
</object-cache>
The code is something like that (we are in a managed environment and this
method is in a session bean):
public void save() throws Exception {
PBKey key = new PBKey(dbName);
PersistenceBroker pb =
PersistenceBrokerFactory.createPersistenceBroker(key);
Action action = null;
Envelope envelope = null;
action = mainObject.getAction();
envelope = action.getEnvelope();
envelope.setTotalAmount(getAmount());
envelope.setenvelopeType(envelopetype);
envelope.setFootNote(getFootnote());
envdetmng.insert(envelope);
pb.close();
}
Under Jboss no problem.
Under WebLogic, when we call mainObject.getAction().getEnvelope(), we get
the "old" envelope, like the envelope has not been updated.
After a clearCache(), everything is fine.
It looks like the db is updated, but not the cache.
Is it a transactional issue ?
Is it a bug in the cache ? (in this case why in Weblogic and not in Jboss)
Any idea ????
David WIESZTAL.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]