[Zope-DB] ZSQLMethod commits inside a DTML method

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


--=-WZhmL33OXdtT4rlrYVQ+
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?

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


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA+1ToKcGIkA/Ca6VkRAm0LAKC1/UdQUQ+vV3lMrZjaQ3HDs1dDYACgkxaH
kFg9w5QhnpHrCZ3FoMWyCVQ=
=3sFm
-----END PGP SIGNATURE-----

--=-WZhmL33OXdtT4rlrYVQ+--