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 Goncalo Luiz <ge...@rnl.ist.utl.pt> on 2003/04/27 22:52:54 UTC

Cache?

Hi.
Is there any cache in OJB 1.0rc2 ?
I sucessfully delete some objects from BD (I can check it by running an
external mysqlclient), but the queries still reading all the objects that
are not there anymore. This occurs after the first query. Is the query
stored in some cache ? How can I avoid this and get always the most recent
state of the DB ?

Thank you,
Gonçalo D. Luiz (gedl@rnl.ist.utl.pt) | Tlm: 933 480 059



Re: Cache?

Posted by Luis Cruz <le...@netcabo.pt>.
To remove an object "obj" from the cache do something like:

PersistenceBroker broker = ((HasBroker) tx).getBroker();
broker.removeFromCache(obj);

Cheers,
Luis Cruz


On Mon, 2003-04-28 at 00:51, Goncalo Luiz wrote:
> Man, I don't know how to thank you.
> Maybe someday I buy you a beer :)
> BTW, Can you tell me how to delete an object from cache ?
> ----- Original Message -----
> From: "Luis Cruz" <le...@netcabo.pt>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Monday, April 28, 2003 12:21 AM
> Subject: Re: Cache?
> 
> 
> >
> > Hello,
> >
> > First you should check which cache implementation you are using in your
> > OJB.properties file.
> >
> > The default cache implementation leaves cache management up to you, in
> > other words when you delete an object you should also remove it from the
> > cache.
> >
> > Also note that if you alter your database externally, the contents of
> > your cache will remain unchanged. In this situation your best off
> > clearing the contents of the cache whenever such alteration take place.
> >
> > If you wish to disable use of cache altogether, just use
> > ObjectCacheEmptyImpl.
> >
> > Hope this helps,
> > Luis Cruz
> >
> >
> > On Sun, 2003-04-27 at 21:52, Goncalo Luiz wrote:
> > > Hi.
> > > Is there any cache in OJB 1.0rc2 ?
> > > I sucessfully delete some objects from BD (I can check it by running an
> > > external mysqlclient), but the queries still reading all the objects
> that
> > > are not there anymore. This occurs after the first query. Is the query
> > > stored in some cache ? How can I avoid this and get always the most
> recent
> > > state of the DB ?
> >
> >
> > ---------------------------------------------------------------------
> > 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: Cache?

Posted by Goncalo Luiz <ge...@rnl.ist.utl.pt>.
Man, I don't know how to thank you.
Maybe someday I buy you a beer :)
BTW, Can you tell me how to delete an object from cache ?
----- Original Message -----
From: "Luis Cruz" <le...@netcabo.pt>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Monday, April 28, 2003 12:21 AM
Subject: Re: Cache?


>
> Hello,
>
> First you should check which cache implementation you are using in your
> OJB.properties file.
>
> The default cache implementation leaves cache management up to you, in
> other words when you delete an object you should also remove it from the
> cache.
>
> Also note that if you alter your database externally, the contents of
> your cache will remain unchanged. In this situation your best off
> clearing the contents of the cache whenever such alteration take place.
>
> If you wish to disable use of cache altogether, just use
> ObjectCacheEmptyImpl.
>
> Hope this helps,
> Luis Cruz
>
>
> On Sun, 2003-04-27 at 21:52, Goncalo Luiz wrote:
> > Hi.
> > Is there any cache in OJB 1.0rc2 ?
> > I sucessfully delete some objects from BD (I can check it by running an
> > external mysqlclient), but the queries still reading all the objects
that
> > are not there anymore. This occurs after the first query. Is the query
> > stored in some cache ? How can I avoid this and get always the most
recent
> > state of the DB ?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>



Re: Cache?

Posted by Mauricio CASTRO <mc...@hotmail.com>.
Check if you commited.


----- Original Message ----- 
From: "Luis Cruz" <le...@netcabo.pt>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Sunday, April 27, 2003 6:21 PM
Subject: Re: Cache?


>
> Hello,
>
> First you should check which cache implementation you are using in your
> OJB.properties file.
>
> The default cache implementation leaves cache management up to you, in
> other words when you delete an object you should also remove it from the
> cache.
>
> Also note that if you alter your database externally, the contents of
> your cache will remain unchanged. In this situation your best off
> clearing the contents of the cache whenever such alteration take place.
>
> If you wish to disable use of cache altogether, just use
> ObjectCacheEmptyImpl.
>
> Hope this helps,
> Luis Cruz
>
>
> On Sun, 2003-04-27 at 21:52, Goncalo Luiz wrote:
> > Hi.
> > Is there any cache in OJB 1.0rc2 ?
> > I sucessfully delete some objects from BD (I can check it by running an
> > external mysqlclient), but the queries still reading all the objects
that
> > are not there anymore. This occurs after the first query. Is the query
> > stored in some cache ? How can I avoid this and get always the most
recent
> > state of the DB ?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>

Re: Cache?

Posted by Luis Cruz <le...@netcabo.pt>.
Hello,

First you should check which cache implementation you are using in your
OJB.properties file.

The default cache implementation leaves cache management up to you, in
other words when you delete an object you should also remove it from the
cache.

Also note that if you alter your database externally, the contents of
your cache will remain unchanged. In this situation your best off
clearing the contents of the cache whenever such alteration take place.

If you wish to disable use of cache altogether, just use
ObjectCacheEmptyImpl.

Hope this helps,
Luis Cruz


On Sun, 2003-04-27 at 21:52, Goncalo Luiz wrote:
> Hi.
> Is there any cache in OJB 1.0rc2 ?
> I sucessfully delete some objects from BD (I can check it by running an
> external mysqlclient), but the queries still reading all the objects that
> are not there anymore. This occurs after the first query. Is the query
> stored in some cache ? How can I avoid this and get always the most recent
> state of the DB ?