[Zope] Zope Persistence (was: XML-RPC within ZOPE)

Lennart Regebro regebro at gmail.com
Sat Dec 17 19:30:39 EST 2005


On 12/17/05, Jan-Ole Esleben <esleben at gmail.com> wrote:
> To simplify, in ZOPE, for any given product, during a
> transaction the product is effectively locked.

This statement is incorrect.

> So if I have, say, a
> list field that contains some data and a dictionary field that
> contains some other data, and the "internal" call changes the dict
> while the original call changes the list, that breaks the transaction,
> while in usual situation in a database, nothing would break.

If you use all non-persistent aware dicts and lists, yes. Using only
dicts and lists is suboptimal in most OO-languages, and that goes for
Python too. It is correct that with Zope, the negative impact of that
type of pre'ogramming-style is increased. This is however simply
solved by not doing that type of suboptimization, and instead using
persistant-aware objects.

> No. It does happen, and it _did_ happen in my original problem. Zope
> doesn't even care if anything actually changes, it just considers an
> object changed that set self._p_changed=1.

No, se above.

> > You just said "different sets of data". That reasonably must mean
> > different objects, unless you envision having huge objects with only
> > marginally connected sets of data all stored as attributes. And then
> > you have other problems. :-)
>
> No. An object usually binds together different sets of data (as in the
> above example - it has several fields, and that is true for almost any
> given object).

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.

> What you are saying is "don't program the ZOPE way",

No, in fact, I'm saying "program the Zope way", and I am beginning to
suspect that the problem is that you are not.

> and it would eventually lead to the conclusion that your product
> classes should not have any persistent data, which is the conclusion I
> have come to.

Then you didn't read what I said.

> > > That's my whole point. I think it is a very
> > > significant point nonetheless, because this is just an extreme case of
> > > what happens when you couple data and programs, and persistent classes
> > > are just that: application data inside program code.

> > Eh, no they aren't.
>
> Please don't just claim stuff.

You do.

> ZOPE has persistent classes. Persistent
> classes store data that in ordinary programs would not survive as
> long.

Not unless you tell them to. If you don't want the data stored, then
do not set it as an attribute on a persistent object.

> In ordinary systems, you would have to find a way to store the
> data and retrieve it, thus having a model that isn't implicit and
> entangled with your code.

What is implicit with it?

> Of course, you could do the same in ZOPE,
> but I addressed that above, and you could mess up ordinary code, but I
> think we're agreed that it is not something you should aim for (and I
> think I have made it clear why I do not believe it's as easy to mess
> up generic Python code in this way)

Well, sorry, it's not clear for me.


To summarize:

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.

You claim that you can't control what a persistent class store. That is false.

You claim that the whole Zope product gets locked, that is false. It's
on a object-basis, not a product basis.

You claim that things get locked that shouldn't be locked in Zope. It
is not clear to me why you say that.

--
Lennart Regebro, Nuxeo     http://www.nuxeo.com/
CPS Content Management     http://www.cps-project.org/


More information about the Zope mailing list