9 Mar
2007
9 Mar
'07
3:30 p.m.
--On 9. März 2007 15:30:23 +0100 Jary Busato <jbusato@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