Hi, I have some problems understanding (and using) the concept of the cache when using multiple databases and determining the object modification level at the store method.
Assume we have two databases A and B with one being the default and one being the backup database. Both connections are configured using the cache: <object-cache class="org.apache.ojb.broker.cache.ObjectCacheDefaultImpl"> <attribute attribute-name="timeout" attribute-value="-1"/> </object-cache> Given the following code sequence with empty databases, I have some problems: AnObject someObject = new AnObject(); [...] PersistenceBroker defaultBroker = PersistenceBrokerFactory.defaultPersistenceBroker(); defaultbroker.store(someObject); // resulting in an INSERT to the default DB [...] defaultBroker.store(someObject); // resulting in an UPDATE to the default DB PersistenceBroker backupBroker = PersistenceBrokerFactory.createPersistenceBroker(new PBKey("backup")); backupBroker.store(someObject); // resulting in an UPDATE to the backup DB, which fails as there is no such row in the DB As far as I understand the code from PersistanceBrokerImpl, it should query the cache and/or the DB: /* if PK values are set, lookup cache or db to see whether object needs insert or update */ if (!insert) { insert = objectCache.lookup(oid) == null && !serviceBrokerHelper().doesExist(cld, oid, obj); } store(obj, oid, cld, insert); The insert should be false, as the PK fields are not null, and the objectCache for the backupBroker should give null. I traced with P6Spy, but I can't detect a SELECT to determine the existence of the row, so I assume the objectCache.lookup(oid) returns true. Any hints? Bernd --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]