db-ojb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armin Waibel <arm...@apache.org>
Subject Re: persistence broker and cache and different connection
Date Wed, 04 Aug 2004 10:18:43 GMT
Hi Joose,

current cache implementations don't take care of this. This will be
supported in OJB 1.1. As workaround you could implement your on
ObjectCache implementation (I modified ObjectCacheDefaultImpl to support 
your requirement, see below) or only use ObjectCachePerBrokerImpl (which
always clear the cache after PB.close or PB.abortTx).

Checked in a new version of ObjectCacheDefaultImpl which supports now a
new flag allows to determine how the key for the cached objects will be
build. Now it should be possible to use the default cache for the same 
metadata model with different connection-descriptor.

Revision 1.25
http://cvs.apache.org/viewcvs.cgi/db-ojb/src/java/org/apache/ojb/broker/cache/ObjectCacheDefaultImpl.java

I don't setup a test case, so no guarantee ... ;-)

regards,
Armin



Joose Vettenranta wrote:

> Hi,
> 
> I have my software running as 2 instance.. using connection-descriptor A 
> and B
> 
> both A and B uses same classes.
> 
> problem:
> 
> if I create something on A it is cached - good, ok
> if I create something on B it is cached - good, ok
> 
> but problem is that A and B's cache is the same. So if I look at bean 
> with connection B and it is previously viewed by connection A, then A's 
> value is shown, always..
> 
> So, how can I make that cache persistent to connections? So that when I 
> do like:
> 
> dao.retrieve(bean(3), fromTableA) != dao.retrieve (bean(3), fromTableB);
> 
> both ones are the same, even though the database is different.
> 
> Using persistentbroker and ojb 1.0.rc6
> 
> Thanks,
> 
> Joose
> 
> -- 
> "Always remember that you are unique, just like everyone else!"
> * http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Mime
View raw message