You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Just Fun 4 You <ju...@nexgo.de> on 2004/03/25 23:04:10 UTC

newQuery or newReportQuery???

 Hi,

I am new to OJB and wondering when I should use QueryFactory.newQuery() and
QueryFactory.newReportQuery(). May be this answers my second question: how
to select specific attributes in a query so that not all attributes are
considered (e.g. which I am not interested in)?

Thank you for your help.

Sven 


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


RE: AW: Object Cache using ObjectCacheJCSImpl

Posted by Guillaume Nodet <gu...@deliasystems.com>.
You should ask to the mailing list of jcs for such questions.

mailto:turbine-jcs-user-subscribe@jakarta.apache.org


Guillaume

-----Message d'origine-----
De : Dirk Manske (Service Respond)
[mailto:servicerespond.dirkmanske@nexgo.de]
Envoyé : lundi 26 avril 2004 12:06
À : 'OJB Users List'
Objet : AW: AW: Object Cache using ObjectCacheJCSImpl


Hi Armin,

oh I see, great. This simplifies it for me. I have two more questions: If I
do not specify an expiration time of the cached object in cache.ccf, is
there a default 'remove objects from cache implementation" which will be
invoked after a certain time? What about the memory shrinker property? If I
set it to true, what is the exact effect and when does make it sense to use
it?

thank you,
Dirk


-----Ursprüngliche Nachricht-----
Von: Armin Waibel [mailto:arminw@apache.org]
Gesendet: Montag, 26. April 2004 11:47
An: OJB Users List
Betreff: Re: AW: Object Cache using ObjectCacheJCSImpl

Hi Dirk,

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:guillaume.nodet@deliasystems.com]
> 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:servicerespond.dirkmanske@nexgo.de]
> 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: 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
>
>
>
> ---------------------------------------------------------------------
> 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
>
>
>

---------------------------------------------------------------------
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



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


AW: AW: Object Cache using ObjectCacheJCSImpl

Posted by "Dirk Manske (Service Respond)" <se...@nexgo.de>.
Hi Armin,

oh I see, great. This simplifies it for me. I have two more questions: If I
do not specify an expiration time of the cached object in cache.ccf, is
there a default 'remove objects from cache implementation" which will be
invoked after a certain time? What about the memory shrinker property? If I
set it to true, what is the exact effect and when does make it sense to use
it?

thank you,
Dirk


-----Ursprüngliche Nachricht-----
Von: Armin Waibel [mailto:arminw@apache.org] 
Gesendet: Montag, 26. April 2004 11:47
An: OJB Users List
Betreff: Re: AW: Object Cache using ObjectCacheJCSImpl

Hi Dirk,

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:guillaume.nodet@deliasystems.com]
> 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:servicerespond.dirkmanske@nexgo.de]
> 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: 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
> 
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 
> 

---------------------------------------------------------------------
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


Re: AW: Object Cache using ObjectCacheJCSImpl

Posted by Armin Waibel <ar...@apache.org>.
Hi Dirk,

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:guillaume.nodet@deliasystems.com] 
> 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:servicerespond.dirkmanske@nexgo.de]
> 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: 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
> 
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 
> 

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


RE: Object Cache using ObjectCacheJCSImpl

Posted by Guillaume Nodet <gu...@deliasystems.com>.
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:servicerespond.dirkmanske@nexgo.de]
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:guillaume.nodet@deliasystems.com]
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:servicerespond.dirkmanske@nexgo.de]
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: 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



---------------------------------------------------------------------
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



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


AW: Object Cache using ObjectCacheJCSImpl

Posted by "Dirk Manske (Service Respond)" <se...@nexgo.de>.
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:guillaume.nodet@deliasystems.com] 
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:servicerespond.dirkmanske@nexgo.de]
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: 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



---------------------------------------------------------------------
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


RE: Object Cache using ObjectCacheJCSImpl

Posted by Guillaume Nodet <gu...@deliasystems.com>.
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:servicerespond.dirkmanske@nexgo.de]
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: 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



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


Object Cache using ObjectCacheJCSImpl

Posted by "Dirk Manske (Service Respond)" <se...@nexgo.de>.
 
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: 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


Any OJB issues when changing from jdbc 2.0 to 1.0?

Posted by "Dirk Manske (Service Respond)" <se...@nexgo.de>.
 Hi all,

we are using ojb-1.0rc5 pb api and a db2 version 7 database. the used driver
is jdbc 2.0 compatible. Now we are demanded to use a db2 driver which
supports only jdbc 1.0. We are asking if there are some limitations (eg
performance, loss of functionalities within ojb ...) from ojb to be expected
when using a jdbc 1.0 level driver? Or is it irrelevant to ojb which jdbc
level is used?

thx,

Dirk


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


Re: newQuery or newReportQuery???

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi sven,

newQuery returns real business-objects (ie. Person) with all attributes filled, 
thus it selects all columns. newReportQuery lets you define what columns you 
want to select, but it returns a simple array of objects (Object[]).

jakob

Just Fun 4 You wrote:

>  Hi,
> 
> I am new to OJB and wondering when I should use QueryFactory.newQuery() and
> QueryFactory.newReportQuery(). May be this answers my second question: how
> to select specific attributes in a query so that not all attributes are
> considered (e.g. which I am not interested in)?
> 
> Thank you for your help.
> 
> Sven 
> 
> 
> ---------------------------------------------------------------------
> 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