[Zope3-dev] Synching objects with underlying datastore

Kapil Thangavelu hazmat at objectrealms.net
Fri Aug 20 00:54:08 EDT 2004


On Thu, 2004-08-19 at 13:00, Garrett Smith wrote:
> We're using a relational database to store _some_ of the attribute
> values for ZODB objects. Since it's possible for the RDBMS to be updated
> independently of Zope, I'd want to synchronize loaded ZODB objects.
> 
> I know about _p_jar.sync() :-)
> 
> Is there a way to enumerate the currently loaded ZODB objects. (By
> 'loaded' I mean those objects whose state is already in memory -- maybe
> 'cached' is what I'm looking for here.) I obviously don't want to take
> the brute force approach and call _p_jar.sync() on all objects.
> 

_p_jar is the datamanager for a collection of persistent objects, ie in
a typical setup it is the zodb connection for a number of objects.
syncing on the data manager only needs to be called once for all the
objects in the collection. however, if your mixing attribute storage for
objects at an application level rather than at a datamanager level
calling sync() on the datamanager will have no effect, as there is no
mechanism for the datamanager to process these application level
invalidations. it sounds like you need to have some sort of queue and
notification management of database changes. if your using postgres or
oracle you can set it up to recieve notifications of rdb changes and
manually invoke some sort of application invalidation on the nesc
objects.

cheers,

-kapil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20040820/29b836d4/attachment.bin


More information about the Zope3-dev mailing list