[Zope] Re: Zope Persistence (was: XML-RPC within ZOPE)
Florent Guillaume
fg at nuxeo.com
Sun Dec 18 12:01:41 EST 2005
Jan-Ole Esleben wrote:
>>Yes. You said "different sets of data". That reasonably means
>>different objects. If it doesn't, yuo need to take a long hard look at
>>your object hierarchy.
>
>
> Simply not true. What if I have a field titles (that is a hash of
> titles to Book objects)
> and a field comments (that is an array of comments on the library)? Is
> that so obviously not a sane example?
You have to understand the Zope persistence mechanism if you want to
have write access to subparts of an objects in parallel transactions not
cause write conflict errors.
Basically, if you want to have that, your object can't be a single
persistent object, but be composed of different persistent subobjects.
> See the example for some major implicitness. It's also implicit
> because you have no control over what a transaction considers a
> tainted object. (You have no real control over the transaction).
Of course you do. An object is "tainted" either if it's Persistent and
one of its attribute is updated, or if it's not Persistent and reachable
from a Persistent object that got "tainted". "Persistent" means a
subclass of persistence.Persistent.
>>If you have two different processes changing the same set of data, you
>>will get confllict errors. You claim that you will not, but this is
>>false.
>
> I am explicitly talking about changing different sets of data within
> the same object. You noted that above yourself.
If you want that, again, then your "different sets of data" have to be
designed using the Persistent base class. PersistentList and
PersistentMapping are examples.
Florent
--
Florent Guillaume, Nuxeo (Paris, France) Director of R&D
+33 1 40 33 71 59 http://nuxeo.com fg at nuxeo.com
More information about the Zope
mailing list