> In <JFULTON.95Jan21162010@dsjfqvarsa.er.usgs.GOV> jfulton@dsjfqvarsa.er.usgs.GOV (Jim Fulton ) writes:
>> transaction:
>> # some code
>> # that makes up the transaction
>> transaction:
>> # This is a sub transaction
>> # Perhaps more code for the first transaction
> What's wrong with:
> TransactionAbort = 'TransactionAbort'
> try:
> # some code
> # that makes up the transaction
> try:
> # This is a sub transaction
> except TransactionAbort:
> # rollback sub transaction
> raise TransactionAbort # Roll back transaction as well
> else:
> # commit sub transaction
> # Perhaps more code for the first transaction
> except TransactionAbort:
> # rollback transaction
> else:
> # commit sub transaction
This does address other types of exceptions. You did not include the
code to begin the transaction. Your code exposes details of the
transaction protocol that I would rather hide and it provides many
opportunities for user error.
> Or did you envision the rollback and commit to be more "transparent"
> operations?
Yes.
-- -- Jim Fulton jfulton@mailqvarsa.er.usgs.gov (703) 648-5622 U.S. Geological Survey, Reston VA 22092 This message is being posted to obtain or provide technical information relating to my duties at the U.S. Geological Survey.