[ZODB-Dev] Checking transaction status?

Michel Pelletier michel@digicool.com
Tue, 10 Jul 2001 14:52:14 -0400 (EDT)


On Tue, 10 Jul 2001, Christian Robottom Reis wrote:

> 
> Hi,
> 
> I'm implementing a simple 'check if data has been changed and warn user
> it's going to be lost' type of check to my app. I've implemented my
> interface to set values to the data instance it holds (thus getting free
> 1-level Undo support, whee), and now I want to check to see if the object
> has been dirtied and warn the user if so. Is there an easy way to check if
> a transaction has been started?

I just spoke with Jim about this (one of the advantages of being in Fburg
for a few days...).  Effectively, there is always a started
transaction.  Opening a connection begins a transaction, both commit() and
abort() start a new transaction.  There shouldn't be any point, currently,
where you are not working in a transaction.

So what's the point of begin()?  So you can be explicit about starting a
new transaction.  Instead of just saying blah blah blah commit().  You do
a begin() first so that you are absolutely certainly where the transaction
boundaries are.

Hope to see some of you at the EuroZope conf in Berlin on Thursday!

-Michel