Re: [ZODB-Dev] Mutating class of an instance

2008-07-02 Thread Jean Jordaan
 Any chance I can get zeo to tell the other clients about the new class?

Speaking purely as an idiot .. can't you tell ZEO the normal way? I.e.
just make it think the instance changed. Edit it, or set _p_changed on
it.

-- 
jean . ..  //\\\oo///\\
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


[ZODB-Dev] Locking

2008-07-02 Thread Joseph Turian
How do I lock zodb objects?

I want the following process:

See if key is present in root.
[it's not]
Lock key write-access, so that no other client will try to write key.
Compute value for key.
Write value for key.
Unlock key.

How do I achieve this?
Thanks!

  Joseph

-- 
Academic: http://www-etud.iro.umontreal.ca/~turian/
Business: http://www.metaoptimize.com/
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] Mutating class of an instance

2008-07-02 Thread Marius Gedminas
On Wed, Jul 02, 2008 at 08:07:56AM -0400, Erik Dahl wrote:
 I have a situation where I want to mutate the class of an instance like 
 this:

 inst.__class__ = NewClass

Is inst a persistent object?  Then your only chance to get this to work
is to find *all* objects that reference inst and mark them _p_changed.

 I'm in zeo land.  When I do this in one client things work fine.

More careful testing would show that not to be the case, I think.

 But of 
 course the other clients who have already loaded the instance still hold 
 the old class.  Restarting them gets the new class so it did get stored 
 properly in the pickle (which I would expect).

The class is also stored in every reference to that object.

 Any chance I can get zeo 
 to tell the other clients about the new class?

Marius Gedminas
-- 
It's my understanding that although in principle TCP can handle huge
throughputs in practice many stacks haven't been optimized for that case, so
you have to either use a utility which opens multiple TCP sessions in parallel
or do something really radical like upgrade to the latest version of the linux
kernel.
-- Bram Cohen


signature.asc
Description: Digital signature
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] Locking

2008-07-02 Thread Andreas Jung



--On 2. Juli 2008 16:45:53 -0400 Joseph Turian [EMAIL PROTECTED] wrote:


How do I lock zodb objects?


Zope provides locking for WebDAV under the hood. Means you can not 
lock/unlock objects directly through the Zope UI (except the global webdav 
lock manager in the ZMI for _unlocking_ content).





I want the following process:

See if key is present in root.
[it's not]
Lock key write-access, so that no other client will try to write key.
Compute value for key.
Write value for key.
Unlock key.



Look at Plone utilizing the webdav locks for app-level locking support.
Or: you can the API in Zope for using the webdav locks (somewhere in the 
'webdav' module, check yourself).


-aj

pgpFtOFSS4kG8.pgp
Description: PGP signature
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev