[Zope] database transaction problem

martin f krafft madduck at madduck.net
Mon Mar 15 03:24:47 EST 2004


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?

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net at madduck
 
invalid/expired pgp subkeys? use subkeys.pgp.net as keyserver!
 
"alle vorurteile kommen aus den eingeweiden."
                                                 - friedrich nietzsche
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope/attachments/20040315/7b0e879b/attachment.bin


More information about the Zope mailing list