Hi Wes,
which API do you use?
The PB-api has no dirty-detection mechanism and do always update all objects specified in the PB.store method. If auto-update is enabled the referenced objects will be updated too.
The ODMG-api only update dirty objects when the tx is commited.
regards, Armin
Lemke, Wesley wrote:
I got the configuration right, so OJB is now using oscache, but OJB is still updating objects that haven't changed.
In my test I create a new object, persist it, sleep for 5 seconds, and then persist it again. The first store does an insert, and the second store does an update. We have a timestamp column in this object, that is getting updated when nothing changes. Here is the field-descriptor for that timestamp column:
<field-descriptor name="lastModifiedDate" column="LAST_MODIFIED_DTM" jdbc-type="TIMESTAMP" conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlTi mestampFieldConversion" />
I have verified that the object is in the cache before the second store.
Is the conversion what is causing OJB to think that the object has changed? If so, how do we get a timestamp field to update only when one of the other fields has changed? If not, what else could be the problem? Where should I look?
-----Original Message-----
From: Lemke, Wesley Sent: Wednesday, April 27, 2005 2:41 PM
To: 'OJB Users List'
Subject: RE: Which Object Cache am I using?
I am using 1.0.2. I'll look into the docs, thanks!
-----Original Message-----
From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 27, 2005 2:40 PM
To: OJB Users List
Subject: Re: Which Object Cache am I using?
Hi Wes,
which version of OJB do you use? In OJB >1.0.2 the setting of ObjectCache is moved to repository file (see release note and caching
docs).
regards, Armin
Lemke, Wesley wrote:
I seem to be having problems with our object cache. Items are getting
updated in the database even when nothing has changed. I am using oscache, as described in the OptimisitcLocking tutorial, and this is what I have in OJB.properties:
#ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCacheDefaultImpl
ObjectCacheClase=com.lmig.pm.affinity.persistence.cache.ObjectCacheOSC
ac
heImpl #ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCacheEmptyImpl
#ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCachePerBrokerImpl
#ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCacheJCSPerClassIm
pl
#ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCachePerClassImpl
However, when I started to debug my problem I noticed that none of the
methods in ObjectCacheOSCacheImpl were being called. So I put some print statements in (broker.serviceObjectCache().getClass().getName()),
and it looks like the Object Cache being used is either:
org.apache.ojb.broker.cache.MaterializationCache or
org.apache.ojb.broker.cache.CacheDistributor. I have read that
MaterializationCache is a type of interal wrapper cache. Why isn't
OJB
using my ObjectCacheOSCacheImpl?
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
