you don't need to cache the objects by yourself it will be done by OJB. If you want to manipulate the cache use the service method provided by PB:
PB.serviceObjectCache()
or to remove objects from the cache, yu can find methods at PB.
> broker.beginTransaction(); > > broker.insert(persistObject); > > broker.commitTransaction(); > broker.close();
now your persistObject should be in cache.
regards, Armin
Dirk Manske (Service Respond) wrote:
thx for your answer Guiiaume. I already did this and use the example (basic)
cache.ccf file from the jcs homepage. But I am using JCS the first time and
there is no much docu available, so I am wondering how it all works. Is it
as easy as
broker.beginTransaction();
broker.insert(persistObject);
broker.commitTransaction();
Identity ident = new Identity(persistObject, broker);
broker.close();
ObjectCacheJCSImpl jcsCache = new ObjectCacheJCSImpl("classForPersistedObject");
jcsCache.cache(ident, persistObject); ???
I am wondering about the Identity object which already holds the persistObject and is now "abused" as key (as far as I know the jcs says to use a String object as key)? My second question is: do I really have to create a new jcsCache object each time or is it just for the first time and then I get the same instance again and again (singleton)? I think it must be the second case otherwise how to get the cached object?
thx, Dirk
-----Urspr�ngliche Nachricht-----
Von: Guillaume Nodet [mailto:[EMAIL PROTECTED] Gesendet: Montag, 26. April 2004 10:42
An: OJB Users List
Betreff: RE: Object Cache using ObjectCacheJCSImpl
I already used it, just configure the right class in ojb.properties for the key ObjectCacheClass, then just configure your cache.ccf file for configuring jcs.
Guillaume
-----Message d'origine----- De : Dirk Manske (Service Respond) [mailto:[EMAIL PROTECTED] Envoye : dimanche 25 avril 2004 21:25 A : 'OJB Users List' Objet : Object Cache using ObjectCacheJCSImpl
Hi all,
I am using ojb-1.0rc5 pb api and a db2 version 7 database. Is someone using ObjectCacheJCSImpl and could provide me a little example of how to use it? Would be great!
thx,
Dirk
--------------------------------------------------------------------- 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]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
