[ZODB-Dev] preventing a transaction from committing within appcode

Kapil Thangavelu hazmat at objectrealms.net
Fri Sep 10 01:58:23 EDT 2004


On Fri, 2004-09-10 at 01:10, Tim Peters wrote:
> [Kapil Thangavelu]
> > another similiar option is via a txn observer pattern
> >
> > a simple txn observer implementation
> >
> <http://svn.objectrealms.net/browse/occams/versioning/trunk/transaction.py?r
> ev=164&view=auto>
> 
> Could you be more explicit?

a registered observer for a txn instance could explictly doom the
transaction upon a pre commit event.

code-wants-to-doom-txn
 register-observer kill-txn
...
txn-commit()
 notify-observers()
  kill-txn aborts the transaction

>   I don't see how observing commit() could help
> Chris, except maybe as a more indirect way of injecting a poisoned jar into
> the transaction.

in this specific case of a doomed txn, i don't think it makes a whole
lot of difference. i do think txn observers are a more general pattern
than jar/datamanager proxies, that can satisfy additional use cases.
such as an if an observer wants to perform work which would lead to
additional jars/objects being registered with the transaction.

-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/zodb-dev/attachments/20040910/2faf4cf3/attachment.bin


More information about the ZODB-Dev mailing list