Objects in transaction-Object do not support absolute_url() (was: Re: [Zope] Catch Object Changes)

Holger Schmidt hs at keppler-it.de
Wed Dec 3 13:40:28 EST 2003


Hello,

am Mittwoch, 3. Dezember 2003 um 19:28 schrieben Sie:

HS> Hallo Dieter,

HS> am Montag, 1. Dezember 2003 um 18:52 schrieben Sie:

DM>> Holger Schmidt wrote at 2003-11-30 15:17 +0100:
 >>> ...
 >>> DM> Looks like you want a specialized transaction or ZODB connection.
 >>> 
 >>> DM>   Whenever an object is changed, it registers with the transaction.
 >>> 
 >>> DM>   When the transaction is about to commit, it informs
 >>> DM>   the object's ZODB connection that the object was modified.
 >>> 
 >>> DM>   Zope uses a two level commit protocol, thus one affected
 >>> DM>   connection may vote against the commit.
 >>> 
 >>> DM>   This means, the hook you are looking for is somewhere in
 >>> DM>   transaction or two level commit handling.
 >>> 
 >>> do you mean a monkey-patch like this?
 >>> or is this bad for any reasons ...?

 >>> ... patching "Connection.commit/commit_sub" ...

 >>> I patched the commit and the commit_sub because I think these methods
 >>> are called after 2PC has succeded, has it?

DM>> The 2-level commit protocol looks like (at the connection interface):

DM>>     tpc_begin --> commit (for each object) --> tpc_vote
DM>>     --> (tpc_finish | tpc_abort)

DM>> Thus, when you patch "commit", there is still a chance that
DM>> lateron the complete transaction is aborted.
DM>> "tpc_finish" is the "final commit".


HS> New Problem:

HS> now i monkey-patch tpc_finish, but what I get is just the
HS> transaction-object.
HS> In the transaction-Object I can find the affected Objects of the TA
HS> (in the "_objects"-List I think) ...
HS> But I cannot get the absolute URL of the affected Objects (cannot use
HS> obj.absolute_url()), I think this is because the objects in the
HS> transaction-object are not acquisition wrapped, are they?

HS> Is there a chance to get the path to the object?

btw obj.getPhysicalPath() just returns the id of the object not the
path :(

-- 
Holger






More information about the Zope mailing list