[Zope-dev] is there a hook for before the transaction is comm itted

John D. Heintz jheintz@isogen.com
Mon, 05 Mar 2001 15:16:58 -0600


Hi Tim,

I'm glad that worked for you.  I think _vote() is the right place to do 
what you want.

See my reply to Steve Alexander for my comments on _v_* attributes.

John

Tim McLaughlin wrote:

> In what respect are the _v_* attribs gonna cause problems.  My guestimate
> was that they disappeared upon transaction commit/abort.  I'm also not sure
> as to why I would need subtrans since I'm only messing with properties of
> the object.  To my knowledge, subtrans are only necessary to conserve
> resources.  Anyway, what you gave me works!  Thanks.  It seems I need to
> override the _vote method (since it is only called once and allows
> exceptions).  As to the other stuff, I'm sure you can enlighten me further
> as to why.  I appreciate the help.
> 
> Cheers.
> Tim
> 
> -----Original Message-----
> From: John D. Heintz [mailto:jheintz@isogen.com]
> Sent: Monday, March 05, 2001 12:45 PM
> To: Tim McLaughlin
> Cc: 'zope-dev@zope.org'
> Subject: Re: [Zope-dev] is there a hook for before the transaction is
> committed
> 
> 
> Hi Tim,
> 
> I have two suggestions, I hope one of them helps.
> 
> 1) Attached is a TM.py file that I wrote based on the one you mention 
> below.  I've tried to make it more obvious and better documented.
> 
> 2) Don't use this kind of functionality, but rather use sub-transaction 
> commits.
> 
> The first suggestion has more overhead than what I assume you would 
> need, but the second one won't work for all situations.
> 
> A Fishbowl proposal of mine, HashingSupport, was going to use the same 
> kind of hook you are asking about.  In this case though, using 
> sub-transaction commits made a lot more sense.
> 
> In general though, I think that _v_* attributes pose a non-trivial 
> problem that probably requires a hook on abort() if not commit() as well.
> 
> John
> 
> Tim McLaughlin wrote:
> 
> 
>> Is there a hook for before the transaction is committed for objects which
>> subclass Persistent?  I found __inform_commit__ for a "registered" object,
>> but I can't seem to get that to work as I thought it did.  I also tried
>> subclassing TM like a DA, but to no avail.
>> 
>> TIA,
>> Tim
>> 
>> ___________________________________________________________
>> Tim McLaughlin                     		BCSwebservices.net
>> Director, Technical Group            	1950 Old Gallows Road
>> tel:  (703) 790.8081 x111		Suite 201
>> tim@bcswebservices.net		Vienna, VA 22182
>> www .bcswebservices. net
>> 
>> 
>> _______________________________________________
>> Zope-Dev maillist  -  Zope-Dev@zope.org
>> http://lists.zope.org/mailman/listinfo/zope-dev
>> **  No cross posts or HTML encoding!  **
>> (Related lists - 
>>  http://lists.zope.org/mailman/listinfo/zope-announce
>>  http://lists.zope.org/mailman/listinfo/zope )



-- 
. . . . . . . . . . . . . . . . . . . . . . . .

John D. Heintz | Senior Engineer

1016 La Posada Dr. | Suite 240 | Austin TX 78752
T 512.633.1198 | jheintz@isogen.com

w w w . d a t a c h a n n e l . c o m