[Zope] PersistentMapping not persistent?

alex@quad.com.ar alex@quad.com.ar
Wed, 7 Nov 2001 15:51:38 -0300


ok, here's a simplified view of my object

__init__(self):
   self.data=PersistentMapping()

createUser(self,user,password,roles=[]):
   self.data[username]={'username': username, 'password': password, 'roles':
roles}

updateUser(self,username,password, roles):
   self.data[username]['roles']=roles
   if password: self.data[username]['password']=password

there's a lot more on the object as you would guess, but that's the relevant
code to my problem.
both create and update works.. but after updating a user password and/or
roles the changes only last for a while, and as I said, if I replace all
this with a self.data={} and signaling with self._p_changed then everything
works fine.

can you see any potential problem in that code?

Thanks for the help

Alex

----- Original Message -----
From: "Chris Withers" <chrisw@nipltd.com>
To: <alex@quad.com.ar>
Cc: <zope@zope.org>
Sent: Wednesday, November 07, 2001 10:34 AM
Subject: Re: [Zope] PersistentMapping not persistent?


> alex@quad.com.ar wrote:
> >
> > is PersistentMapping fscked up on 2.4.2 or does it still need something
> > similar to self._p_changed=1 to commit all the transactions back into
zodb ?
>
> I suspect it's rather something that you are doing that is fscked up ;-)
>
> Perhaps you can explain what you're putting in self.data and we can see
what's
> going on...
>
> cheers,
>
> Chris
>
> PS: For _lots_ of users, use an OOBTree instead of a PersistentMapping
>