[mod_python] Question on Transactions

jalil jalil at securia.com
Sat Feb 7 12:32:33 EST 2004


Thanks for the reply. Yes, this is a database transaction and I want to, 
as you described,  make sure all updates or none happens.


Robert Lilly wrote:

>>[mailto:mod_python-bounces at modpython.org]On Behalf Of jalil
>>Sent: Saturday, February 07, 2004 10:28 AM
>>Subject: [mod_python] Question on Transactions
>>I am looking for a clean way to create a transaction and use it across
>>multiple method calls. For example, method A calls B and C. B updates a
>>row successfully but C fails. I like A to abort changes made by B. I
>>thought about doing it by passing a connection created in A to B and C
>>so I can rollback if needed in A. But I don't like this approach.  I
>>like B to creates its own connection but join the transaction that
>>already started by A (or somehow get the same connection) or use its own
>>transaction context (or a new connection) if none there.
>>I wonder how other people do this using Python.
>Jalil, is this a database transaction? It sounds like the Atomicity part of
>the ACID test for DBMSes where when a transaction that updates the database
>occurs, either all of the update occurs, or none of the update occurs, even
>if a hardware or software failure occurs during the transaction.
>I'm not sure how DBMSes accomplish this, but maybe the same principle would
>work for you.
>Sorry I'm not of much help, but maybe this will assist others to get a
>better idea of your situation.
>Mod_python mailing list
>Mod_python at modpython.org

More information about the Mod_python mailing list