[Zope-DB] Two actions in one ZSQL method = one transaction?

Andreas Jung lists at zopyx.com
Thu Jun 14 00:54:26 EDT 2007

--On 13. Juni 2007 21:11:08 -0400 Ken Winter <ken at sunward.org> wrote:

> I have a question (stated in three different ways) about the following
> ZSQL method:
> 1.  Will it *always* return the person_id of the person that it just
> inserted?

You have to answer this question your self. It depends on your database, 
your isolation level and your database adapter

> 2.  Will it do this even if another user inserted another person just in
> between the two SQL actions in this ZSQL method?

see above.

> 3.  In other words: Does a ZSQL method initiate a database transaction, so
> that no other user can inset another record between the two actions in
> this ZSQL method?

This is a completely different question. *If* you database provides 
transaction support and *if* your DA integrates with the transaction of Zope
*then* everything happening within one Zope request will happen within one 
Zope transaction and therefore within one DB transaction. This isn't
necessarily true to databases like MySQL.


-------------- 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-db/attachments/20070614/daf7c4e8/attachment.bin

More information about the Zope-DB mailing list