Nils Liebelt wrote:
Having some trouble with the OJB caching. I use the default implementation
which should give a global cache for all Brokers.
My Business objects have a store() method that inserts/updates this object
towards the db and removes this object from the cache with the
removeFromCache() function. But the changed object still doesn't get newly
retrieved in relationships! Let's say I got an Account which has many
Contacts attached. If I change a Contact, store it and remove it from the
cache. The Account still has a reference to the old the account object? My
idea to solve it was an business function updateReferences() which needs to
be called from the "mother" object. But my OO-mind tells me that that's not
right. I don't want to pollute my simple BusinessInterface with complicated
things like that. So I could turn off the cache. Well not an option for me
or I could call the retrieveAllReferences() before retrieving which comes
close to turning off the cache. I wonder if there's not an nicer and more
clean way in doing so.
I think I read between the lines that you use the PB API, right?
If the Account is referencing a Contact that you update and store,
why do you want to clear this entry and reload it from DB? It should
be OK in the first place? PB is pretty low-level when it comes to
managing object graphs and you have to do everything by hand.
If you want more automagical object graph handling maybe ODMG is
an option for you? (Although personally I have little experience with
ODMG and caching and can't give you concrete hints there.)
Regards,
Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]