[Zope] database transaction problem
Kapil Thangavelu
hazmat at objectrealms.net
Wed Mar 17 02:15:37 EST 2004
at this point i would try debugging the problem w/ pdb, insert a pdb
statement somewhere in the exUserFolder auth source that corresponds to
the method that does the auth check. there is some howto material on
zope.org on using the debugger.
as for the isolation level, i don't know off hand, a quick source
inspection doesn't make it apparent either. i saw ref to this on the
init.d pyscopg list, and i would suggest asking there. its a question of
calling set_isolation_level on the connection object if you want to hack
the source.
-kapil
On Mon, 2004-03-15 at 03:24, martin f krafft wrote:
> also sprach Kapil Thangavelu <hazmat at objectrealms.net> [2004.03.15.0858 +0100]:
> > thats odd then, i would check with another python script/zsql method if
> > you can access the record inserted as a sanity check.
>
> i did that, and the record is indeed present.
>
> > i might suspect some sort of internal caching within xuf, if the
> > second python script/zsql method is able to access the record.
>
> good thinking. i had "Credential Cache Timeout in Seconds" set to
> 900 in xuf, but please also keep in mind that I am calling
> updateUser on the acl_users.currentAuthSource, which invalidates the
> cache with respect to that user.
>
> Here's the code:
>
> context.sql.create_user(
> login=username,
> [...]
> )
>
> passwd = REQUEST.form['password']
> context.acl_users.currentAuthSource.updateUser(username, passwd, ['Member'])
>
> profiles = container.aq_parent.aq_parent.community.profiles
> profiles.invokeFactory(id=username, type_name='Profile Folder')
>
> mt = context.portal_membership
> context.plone_utils.changeOwnershipOf(obj, username, 0)
> mt.setLocalRoles(obj=obj, member_ids=(username,), member_role='Owner')
>
> Anyway, I set the cache to 0 (No caching), but the problem persists.
>
> > possibly (unlikely) this could be an artifact of zpsycopg's own
> > txn isolation settings, another thing to try would be to switch
> > from serialized (default) to read committed.
>
> I am afraid I can't seem to find a setting for this. How would
> I make the database connection use a different isolation level?
More information about the Zope
mailing list