[Zope] atomic operations

Danni Efraim danni@galdrion.com
Thu, 26 Jul 2001 20:59:25 +0200


I am only a MySQL-novice, so correct me if I am wrong, but as long as your 
Zope instances have separate connections, shouldn't last_insert_id() return 
the last inserted id of that particular session, and thus be safe anyhow?

If not, how about using transactions, or (icky icky yuk!) locking the table?

And finally, wouldn't such a question be better asked on a MySQL-list?

/Danni

> Hi folks!
>
> I have a table it has an auto increment fields. How could i have the id id
> insert by my last query atomically? I know i could use last_insert_id()
> function with MySQL, but since my mysql handler is shared by many instances
> of Zope, i cannot garantee that no other query runs between the insert and
> the select last_insert_id queries.
>
> Any ideia ?