[ZODB-Dev] want transaction end hook

John Belmonte jvb at prairienet.org
Fri Oct 24 13:36:57 EDT 2003


Hi,

The last post reminded me of an issue with my own application.

I have something like a bank account object, where the balance is 
represented with a special scalar object with conflict resolution.  The 
conflict resolution allows relative changes to the value to be merged, 
and prevents the value from going below zero.  But sometimes I'm doing a 
transaction where I need a different minimum, like "don't let this 
transaction succeed if it will bring the balance below 10".  So the 
conflict resolution handler is changing dynamically according to the 
type of transaction that I'm doing.

I need to know when a transaction has ended, either by commit or abort, 
so that I can reset any conflict resolution handlers back to their 
normal state (in this case, not letting the balance go below zero).  The 
issue is that I don't want to track all the ways a transaction can end 
(manually calling commit/abort, conflict error, call to sync(), etc.). 
I wish there was a transaction end hook available.

-John


-- 
http:// if  ile.o g/




More information about the ZODB-Dev mailing list