[Zope] database transaction problem

Dieter Maurer dieter at handshake.de
Sun Mar 14 15:27:06 EST 2004


martin f krafft wrote at 2004-3-14 07:32 +0100:
>I am experiencing a problem with my Zope application, interfacing
>with PostgreSQL through PsycopDA. The problem is basically that
>a python script creates a new record in a database table, which is
>used by exUserFolder as a backend for authentication (thus
>containing the list of all users). When this completes, the script
>calls another script which tries to change ownership of a ZoDB
>object to the newly created user, which fails because
>
>  "Only users in this site can be made owners."
>
>I think the problem is rooted in the fact that python scripts work
>on databases in transaction batches, and as the script has not
>finished, the transaction adding the user has not been committed.
>
>Other than issuing a manual COMMIT, how can I make sure that
>exUserFolder sees the changes made to a database while the script is
>still executing?

One way to esure that things are done would be to redirect after
the database modification (i.e. make a new request).

-- 
Dieter



More information about the Zope mailing list