[Zope-DB] rollback / commit inside DTML : How To ??

Federico Di Gregorio fog@initd.org
10 Oct 2002 17:07:04 +0200


--=-1/+LZoLBmaZ4yzCU9RoV
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Il gio, 2002-10-10 alle 16:59, Harald Koschinski ha scritto:

> But: If you have some more complicated applications there are several=20
> transactions and subtransactions during one REQUEST.
> In the case of a failure you don't want to have a rollback for all=20
> transactions - you (I) want to controll which transactions have to=20
> commit by hand. :-(

the plug your code into the zope transaction machinery. doing random
commits on the Zxxx Connection object is a bad idea because it will
confuse all the remaining code. also, why don't you rethink your
application? any zope application that requires multiple commit/rollback
in a single request looks fragile to me.

> So I ask my question again: How can I use the python functions for=20
> transaction control inside DTML.
>=20
> (please don't give the answer, that developing in DTML is a mistake and=20
> python is more clever for such complicated application. I use both in a=20
> mixed structure but decided to do the database
> transactions in dtml, because zsql is very nice)

and doing so you commited yourself to the 1:1 REQUEST/TRANSACTION model.
--=20
Federico Di Gregorio
Debian GNU/Linux Developer & Italian Press Contact        fog@debian.org
INIT.D Developer                                           fog@initd.org
                             Best friends are often failed lovers. -- Me

--=-1/+LZoLBmaZ4yzCU9RoV
Content-Type: application/pgp-signature; name=signature.asc

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

iD8DBQA9pZeYvcCgrgZGjesRAhnfAJ4wPMSuZxVCYvVd6PYIKwEVDEQPBwCfY598
c9OIDWBmvfqrY3KPSMZ9LIc=
=XCPB
-----END PGP SIGNATURE-----

--=-1/+LZoLBmaZ4yzCU9RoV--