db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armin Waibel <arm...@apache.org>
Subject Re: [vote] Make TwoLevelCache the Default in 1.1
Date Wed, 06 Oct 2004 16:28:05 GMT
Brian McCallister wrote:

> Basically a PerBroker cache which defaults to a DefaultObjectCache (with 
> stripped relations) on miss. That is a little simplified, but Armin can 
> describe it better than I can.
>

I can describe it better in German than you, but English... ;-)

During a PB-tx all used objects are buffered by the first level cache 
(LocalCache.java) on commit the buffered objects are pushed to the 
second level (as Brian said above, a "normal" ObjectCache 
implementation). On abort all buffered objects will be discarded.

The first level cache is not shared (single threaded) and bind to a PB 
instance (LocalCache.java), the second level cache is shared across a 
PersistenceConfiguration PC (some times shared across different PC via 
object invalidation, e.g. different metadata model work on same DB) and 
was part of the PC instance (CacheManager.java)

Between the first and second level the CacheStrategy.java implementation 
prepare/change/modify the objects for the second level. With a 
CacheStrategyDefaultImpl property now it is possible to enable the first 
version of a "real" two-level cache. CacheStrategy make "copies" of the 
passed objects from the first level cache and push these "new" objects 
to the second level (the used ObjectCache implementation). This way the 
second level always in sync with the DB.

On lookup the CacheStrategy lookup the "copy" from second level cache 
and rebuild the cached object. This object was passed to the first level 
cache ...

Hope this help, all requests in German or Swiss dialect ;-)

Armin





> With Default right now there are some nasties as it keeps relations 
> which you may be expecting to be unloaded, particularly when you factor 
> in serialization and locking.
> 
> -Brian
> 
> On Oct 6, 2004, at 11:44 AM, Jakob Braeuchi wrote:
> 
>> hi brian,
>>
>> excuse my ignorance, but what exactly is the TwoLevelCache ?
>>
>> jakob
>>
>> Brian McCallister schrieb:
>>
>>> We should make the new TwoLevelCache (thank you Armin!) the default 
>>> in 1.1 (heck, I'd like to in 1.0.2, but that is too big a change for 
>>> bugfix).
>>> I think this is a no brainer, but is a significant change as most 
>>> people just use whatever the default is.
>>> -Brian
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 
> 

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


Mime
View raw message