[Zope] ZMySQLDA and LAST_INSERT_ID() under heavy load

Ragnar Beer rbeer1 at uni-goettingen.de
Thu Sep 2 12:48:27 EDT 2004


Howdy everyone!

LAST_INSERT_ID() in MySQL returns the number of the last automatically
generated autoincrement value on a per-connection basis. Now, as far as I
understand, when using ZMySQLDA all queries share one connection which
saves a lot of time, because it is not necessary to open a new connection
for each and every statement.

But what happens when the server load is increasing and there are many
insert statements? Wouldn't it be possible that another insert would be
executed by another Zope thread in between an insert and a corresponding
select LAST_INSERT_ID() so that LAST_INSERT_ID() would not return the
expected value?

Cheers,

Ragnar


More information about the Zope mailing list