AW: Problem/misunderstanding with ObjectCache, multiple databases and ObjectModification, 1.0.4

Längerich, Bernd <[email protected]>
Newsgroups gmane.comp.jakarta.ojb.user
Message-ID <[email protected]>
Hi Armin,

thank you for your fast response.

Armin Waibel writes:

> You are right, OJB find the object in the cache (because you operate 
> with the same objects on different DB's using a shared cache) and 
> indicate to update the object instead of insert.
> 
> Do you really need a shared cache on your "backup" broker? I would 
> recommend to use a "per broker cache" (for backup-broker)
> http://db.apache.org/ojb/docu/guides/objectcache.html#ObjectCachePerBrokerImpl
>Then OJB will not find the object in the cache of backup-broker and 
>perform a DB select.

Okay, thanks for the clarification. I was not aware, that the ObjectCacheDefaultImpl is shared amongst all connections as I declared the cache at connection level, but reading the words "global" and "static Map" in the documentation really helps :-).
As we create a broker on demand and discard it after single use, the per broker cache is not helpful at all, so I will use ObjectCacheEmptyImpl.

Bernd
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.