[Zope-DB] transaction-control with postgres via Zope

Dieter Maurer dieter@handshake.de
Wed, 5 Dec 2001 22:55:24 +0100


Axel Missbach writes:
 > i'm trying to use transactions to control the database (Postrges).
 > the direkt SQL-call "BEGIN WORK", "COMMIT" or "ROLLBACK" seems not to be
 > the right way.
 > 
 > Reading in maillist always the ZODB-function "get_transaction", but it
 > is unreachable in python-script.
 > "
 > import ZODB
 > get_transaction().begin()
 > "
 > the result is an attribute-error.
Are you sure, it is an "AttributeError", not a "NameError"?

"get_transaction" is a method in the "__builtins__" module.
PythonScripts have a non-standard "__builtins__" for security reasons.
It probably does not contain "get_transaction".

You need to use either an External Method or maybe an XXPythonScript
(--> mailing list archives)...


Dieter