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:28:17 EST 2003


Hallo Dieter,

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".


New Problem:

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

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

-- 
Thanks,
Holger







More information about the Zope mailing list