[Zope-DB] ZSQLMethod commits inside a DTML method

David A. Riggs lukewarm@ultrasoul.com
28 May 2003 18:36:58 -0400

Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

I'm trying to execute multiple ZSQLMethods in series inside
a DTML method...

<!-- Start DTML method -->

<dtml-call sqlMethod1>  <!-- insert row in table 1 -->
<dtml-call sqlMethod2>  <!-- insert row in table 2 -->
<dtml-call sqlMethod3>  <!-- insert row with foreign keys -->

<!-- End DTML method -->

The first two ZSQLMethods insert rows into two tables, the
third inserts a row which references these other two tables
with a foreign key.

If I call them individually, in other words ensure that the
rows from the first two calls have been inserted, then the
third ZSQLMethod works as expected. However when calling the
three of them as above in a DTML method, the third fails
citing referential integrity violation for not seeing the
key from the other tables.

I'm not able to find documentation which states explicitly,
so I'm asking here, are these ZSQLMethods committed with each
call or only at the end of the enclosing DTML method?

- David A. Riggs <lukewarm@ultrasoul.com>

Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

Version: GnuPG v1.2.1 (GNU/Linux)