If I understood you're telling me that begin and commit statements are "redundant".
Sometimes conflicts are not correctly managed by ZTM (no rollbacks in db)

Marco Bizzarri ha scritto:
On 3/9/07, Jary Busato <[EMAIL PROTECTED]> wrote:

 Yes, I must do it when I need to know an autonumber PK after an insert.
 when DB support transaction i write:

 begin transaction
 insert foo into bar
<dtml-var sql_delimiter>

 Then, a DTML method:

 <dtml-in myZSQLinsertandselect()>
  <dtml-var lastid>

 Make the insert and write the id returned by the select.


This is not good. Keep in mind that Zope transaction management can
cause your full transaction to be aborted and reissued if there is a
conflict during it; this will normally result in a transaction being
aborted on the database, and reissued.

In other words, you could end with something like:

--> your request
begin (issued by Zope)
sql statemnets
<conflict detected>
abort (issued by Zope)
begin (issued by Zope)
(again) sql statements
commit (issued by Zope)
<-- your response

Issuing an explicit commit inside this can cause very strange
behaviour in your application.


Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to