[Zope-DB] How to use commit/rollback etc. with Zope + ZpsycopgDA ???

Emmanuel Courcelle emmanuel.courcelle@toulouse.inra.fr
Mon, 25 Mar 2002 15:44:06 +0100


I am currently developping an user interface towards a postgresql
using Zope  +  ZpsycopgDA.

Here is my pb:

I have a python external script, with some code like:

for i in some_list:

The pb is that if one of the context.zsql_some_other_method(...)  gets
an error,
the database is inconsistent. This could be solved using only ONE
BUT the Zope zsql methods are wrapped inside a transaction, so that
I have a transaction for EACH zsql call.=20
I would prefer ONE transaction for the WHOLE process.=20
I cannot insert all the sql code inside the same zsql method, because as
fas a I know
it is not possible implementing for loops inside a zsql method.

So, what is the solution ???

Thanks in advance,

Emmanuel COURCELLE                   emmanuel.courcelle@toulouse.inra.fr
L.B.M.R.P.M. (C.N.R.S.-I.N.R.A.)     tel (33) 5-61-28-54-50
B.P.27 - 31326 CASTANET TOLOSAN Cedex
S'ils te demandent de te taire, d'attendre, de patienter encore
N'=E9coute que ton =E2me et agis. Djur Djura