[Zope-DB] Transaction questions

M.-A. Lemburg mal@lemburg.com
Wed, 17 Jul 2002 20:17:30 +0200


M.-A. Lemburg wrote:
> Jose Gerardo Amaya Giron wrote:
> 
>> I want to use MS SQL Server transactions, do I need to include them in
>> my SQL Methods or Zope is doing this already when I call them.
>> I make some inserts to several tables(separate methods) and when one of
>> them fail it does not roll back to the initial state.
>> What do I need to do.
> 
> 
> I'd to know that too. More precisely, how can a Zope DA hook
> itself up with the Zope transaction mechanism ?
> 
> This is esp. important for the mxODBC Zope DA we are working
> on since it defaults to transaction based behaviour which means
> that without .commit() call, transactions are not committed
> to the data source.

Nevermind, reading the Zope DA intro I see that all we need
to implement is:

     def _begin(self):

         """ Start a transaction.
         """

     def _finish(self):

         """ Commit the transaction.
         """

     def _abort(self):

         """ Rollback the transaction.
         """

and the rest is magic by the Zope transaction manager.

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
_______________________________________________________________________
eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,...
Python Consulting:                               http://www.egenix.com/
Python Software:                    http://www.egenix.com/files/python/