On Sat, 16 Mar 2002, Robert Ln wrote:
Hi all, 4) Finally, the mysql docs say the last_insert_id() returns the last automatically generated id on a per-connection basis. If in zope only a single connection is made and a lot of clients are accessing it at once, how do I guarantee I get back the correct id? I thought you could concatenate multiple SQL queries in one zsql method, but that doesnt seem to work anymore.
I think that this is not a only-Zope question, but a database one. One approach can be: a. get the next_id (example: "select nextval from table"); b. use this id to insert the new row. So you can guarantee that you know what id are you using. Hope this helps, Carlos. [ all about zope+web : http://www.improveyourweb.com ] _______Carlos Costa Portela_________________________________________________ | e-mail: ccosta@servidores.net | home page: http://casa.ccp.servidores.net | |_____Tódalas persoas maiores foron nenos antes, pero poucas se lembran______|