You should not bother accessing direcly jcs.
The cache will be created by ojb and
you can retrieve objects using ojb
with a broker.getObjectByIdentity.

For the jcs cache implementation in the ojb distrib,
you're right that it should use a string as the key.
Personnally, i copied the given class and changed
to use the identity.toString() as the key instead
of the identity object itself.

broker.beginTransaction();
broker.insert(persistObject);
broker.commitTransaction();
Identity ident = new Identity(persistObject, broker);
Object obj = broker.getObjectByIdentity(ident);
broker.close();

Guillaume

-----Message d'origine-----
De : Dirk Manske (Service Respond)
[mailto:[EMAIL PROTECTED]
Envoy� : lundi 26 avril 2004 11:37
� : 'OJB Users List'
Objet : AW: Object Cache using ObjectCacheJCSImpl


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]

Reply via email to