we have a similar problem. We want to access two databases each of them with its corresponding
Z MySql Database connection. We want to:

1- Insert record A into ERREUS database
2- Get auto_increment id for record A
3- Insert record B into IRAKAZI database with auto_increment id.

when we execute steps 1 and 2 within a python script, it's correct.
when we execute steps 2 and 3 within a python script, it's correct.
but, if we want to execute all the steps together we receive this message:
*Error Type: OperationalError*
*Error Value: (1205, 'Lock wait timeout exceeded; Try restarting transaction')*

Can someone help us, please?



Message: 1
Date: Sun, 15 May 2005 16:30:38 -0400
From: "Michael Schwartz" <[EMAIL PROTECTED]>
Subject: [Zope-DB] MySQL ZSQL Transactions or Commit in Zope?
To: <zope-db@zope.org>
Content-Type: text/plain; charset="us-ascii"

I am trying to find sample code for performing transactions in ZSQL with
mysql 4.1.  I'd like to do something like this:

1 - Insert record A into USER table
2 - Get auto_increment id for record A
3 - Insert record B into WIDGET table with auto_increment id from
previous step

But if step 3 fails, I want to undo step 1.

Do I need to back out manually?

Thanks in advance!

Mike Schwartz

_______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db

Reply via email to