[storm] Joining a Zope Transaction
Andreas Kopecky
andreas.kopecky at meduniwien.ac.at
Thu Apr 16 14:32:44 BST 2009
Hi,
I am a bit lost with finding out how exactly Storm joins Zope
transactions and if it is possible to push some - well - extra
code into those event queues Storm uses in the process.
Heres what i found out until now in the - sadly - undocumented
Event Machine:
- Storm defines an implementation to IDataManager that is used to
bring a store in sync with a Zope transaction
- The joining of a DataManager to a Zope transaction is done by
a callback hook that reacts to an event broadcasted by the
EventSystem (namely 'register-transaction')
- Registration of this event handler is done in a few spots, mainly
Store.add, Store.remove and Connection.execute
- Somehow the callback handler deregisters itself by returning
False once it is executed once.
Well. After that i am at a loss sadly. What i would want to do is
trace the changes to Storm objects during one transaction and do
something with them after a commit or rollback happend (for
instance logging which changes to which database rows have
occured within one browser request)
The two ideas i had in mind for this are either publishing those
changes using custom descriptors to a DataManager, join this manager
with the zope transaction as you do in your package and wait for a
commit or - which i would prefer - somehow utilize the EventMachine
for this job since it obviously does track some or all changes anyway.
And suggestion on which is prefereable or if both are stupid ideas that
should be discarded for another approach would be highly appreciated :)
- regards,
Andreas Kopecky
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 549 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/storm/attachments/20090416/0e41040c/attachment.pgp
More information about the storm
mailing list