[Zope] Undo machinery and OOBtrees
Paul Winkler
pw_lists at slinkp.com
Sun Jan 11 16:00:03 EST 2004
On Sat, Jan 10, 2004 at 08:47:00PM -0800, Alec Mitchell wrote:
> On Saturday 10 January 2004 12:22 pm, Dieter Maurer wrote:
> > Not that I know of. Or stricter:
> >
> > I am quite sure that they use transactions in the usual manner.
> >
> > However, Zope's "undo" is easily fooled.
> > A transaction is associated with "PUBLISHED.getPhysicalPath()", independent
> > of which objects is modifies.
> > This may imply that you do not see an "undo" record at the place
> > where you expect it.
> > However, you should see it at the "Root Folder" level.
>
> Yes, it is there! Thank you. I had looked a few folders back from the
> instance but not at the root. That's great. Is there any way to get the
> transaction associated with the proper object? I tried the method listed in
> a recent zopelabs.com recipe:
>
> get_transaction().note('/'.join(foo.getPhysicalPath()))
I posted that recipe, and I don't pretend to really understand
how it works ;-)
I read a bit of ZODB source, discovered the "note" method,
and fiddled around until I came up with the above which seems
to work for me. I would appreciate improvements, corrections
etc:
http://www.zopelabs.com/cookbook/1072135864
--
Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's SUPER MERRY DISHWASHER INVADER!
(random hero from isometric.spaceninja.com)
More information about the Zope
mailing list