[Zope3-Users] SQL Database Bug?
David Johnson
djohnson at jsatech.com
Wed May 10 14:21:01 EDT 2006
I figured this one out. Auto commit on the database is not on. I'm
assuming the Zope or Python mysql driver or a database driver somewhere has
set the default of auto commit to off.
_____
From: zope3-users-bounces at zope.org [mailto:zope3-users-bounces at zope.org] On
Behalf Of David Johnson
Sent: Tuesday, May 09, 2006 11:40 AM
To: 'user-list zope'
Subject: [Zope3-Users] SQL Database Bug?
The following code seems to be buggy somehow, but I'm not clear how or why.
It seems for some reason that the first SQL "insert" query I run does not
get processed, while the second one does. I've tried numerous variations on
this with no success. I've done inserts before without problems.
# The transaction ID "dj3" already exists in all cases, so both
queryForResults calls should
# throw an exception, however only the second, third, fourth do.
query = "insert into transactions (transid) values ('dj3')"
print query
queryForResults(self.db,query)
queryForResults(self.db,query)
queryForResults(self.db,query)
queryForResults(self.db,query)
Generates:
DatabaseException: (1062, "Duplicate entry 'dj3' for key 1")
--
David Johnson
djohnson at jsatech.com
201 Main Street Suite 1320
Fort Worth, TX 76102
(877) 572-8324 x2200
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20060510/98ceca7f/attachment.htm
More information about the Zope3-users
mailing list