[Zope3-dev] Database Transaction Handling

Jim Fulton jim@zope.com
Thu, 31 Oct 2002 14:50:13 -0500


Axel Missbach wrote:
> Hello,
> 
> in my opinion a great handicap of zope2 is occuping the 
> database-transaction for the kommunikation  of documents and extern 
> databases(i.e. postgres).
> 
>     implicit start transaction to database
>     opening document
>     .
>     .
>     .
>     close document
>     implicit commit/close transaction to database
> 
> There is no transaction left to handle the querys/ data of the database.

I don't follow you. Everything Zope does is in one transaction that
affects ZODB and relational databases together.


> What about of explizit using the transaction handling by the 
> user/developer?

This is possible now. In Zope 2, just:

   get_transaction().commit()

to commit. There are similar calls to abort or even begin.
Beginning a transaction aborts any already started transactions.


> Isn't it possible to create an zope intern transaction handling without 
> interacting with the database?

I don't know what "create an zope intern transaction handling" means.


 > Implementing something like
> triggers/events for documents,

I don't know what this would mean.


 > so having the possibility to change the
> default behavior?
> i'd like to handle the database transaction like this:
> 
>     opening document
>     sql_query starts transaction
>     sql_query gets data
>     doing something
>     .
>     deciding if commit or rollback the querys
>     closing document

What do you mean by "document"?  You don't open or close objects
commonly refered to as documents in Zope 2, so I don't think I
have any idea what you are refering to.

Jim

-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (888) 344-4332            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org