[ZODB-Dev] Can I abort part of a transaction setting self._p_changed=0 ?

Steve Spicklemire steve@spvi.com
Thu, 28 Jun 2001 14:57:50 -0500


Hmm.. so either this question was:

1) Totally unclear and therefore unanswerable

2) Totally stupid and therefore not worth the time ... or.. 

3) So far out that nobody really knows... 

In case it's (1) I should clarify that by 'self.CommitObject', I mean
"export self as a .zexp/.xml to CVS (or something)". 

does that help? I is (2)? I can't believe it's (3), but if so... I
should start digging in the code.

thanks,
-steve

------------------------------------------------------------------------


I suppose this is more of a Zope question than a ZODB question, but here goes:

One of the problems with ZCVSFolder is containerish objects (e.g.,
Folder, Specialist, etc). In Zope, these are all basically subclasses of
ObjectManager. The problem is that if you want to commit a subclass of
ObjectManager you get not only it's meta_data, but also its contents. My
idea is to set up a system that essentially does:

def CommitMetaDataOfObjectManager(self, anObjectManager):

        holder = anObjectManager._objects
        delete anObjectManager._objects
        result = self.CommitObject(anObjectManager)
        anObjectManager._objects = holder
        return result

so that the 'committed' objectManager is stripped of it's objects,
committed, and then it's objects are restored. (it would be great if
ObjectManager could present an interface that did that!). The problem is
that fiddling with _objects will set the _p_changed flag and introduce
an unwanted side effect of updating ZODB. Can I force _p_changed=0?
Would that make this a thinkable possibility?

thanks,
-steve