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 Phase Web and Multimedia <ma...@phase.ws> on 2002/12/11 10:24:38 UTC

Caching?

I have an ARTICLE that belongs to a CATEGORY
If i delete my CATEGORY and go back to delete my ARTICLE to edit it. I still
have a reference showing up to the CATEGORY which was deleted. How do I make
sure that the deleted category change appears in my article instance without
using the refresh="true" attribute in the collection-descriptor.

Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
mail@phase.ws
http://www.phase.ws



Re: Caching?

Posted by Thomas Mahler <th...@apache.org>.
Hi again,

There are some methods to interact with the cache.
You can call PersistenceBroker.clearCache() to completely flush the cache.
You can use PB.removeFromCache(instance) to remove a certain instance 
from the cache.

when an instance is not longer in the cache OJB is forced to lookup the 
db to retrieve an object.

So by PB.getObjectByIdentity(new Identity(instance)) you can retrieve a 
fresh copy of instance that is in sync with the DB.

cheers,
Thomas

Phase Web and Multimedia wrote:
> I have an ARTICLE that belongs to a CATEGORY
> If i delete my CATEGORY and go back to delete my ARTICLE to edit it. I still
> have a reference showing up to the CATEGORY which was deleted. How do I make
> sure that the deleted category change appears in my article instance without
> using the refresh="true" attribute in the collection-descriptor.
> 
> Brandon Goodin
> Phase Web and Multimedia
> P (406) 862-2245
> F (406) 862-0354
> mail@phase.ws
> http://www.phase.ws
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 
>