[Zope] How can run multiple query in an Z sql method

Andreas Jung lists at zopyx.com
Fri Mar 9 10:30:08 EST 2007



--On 9. März 2007 15:30:23 +0100 Jary Busato <jbusato at libero.it> wrote:

> Yes, I must do it when I need to know an autonumber PK after an insert.
> when DB support transaction i write:
>
> begin transaction
>
> insert foo into bar
> <dtml-var sql_delimiter>
> SELECT LAST_INSERT_ID() as lastid
> commit

Sorry, but you must be crazy to perform you own transaction handling within 
Zope. Dealing with transactions is the task of Zope and your database but 
it is *not recommended* to perform your own transaction hand here...at least
not in this way. If you want o integration a third-party system the 
transaction handling of Zope: look at the DataManager API of Zope's
transaction module.

-aj

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20070309/6e4a3c3b/attachment.bin


More information about the Zope mailing list