[ZODB-Dev] RFC: Pre-commit hooks

Julien Anguenot ja at nuxeo.com
Mon Apr 4 15:29:35 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jim Fulton wrote:
> Julien Anguenot wrote:
> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Jim Fulton wrote:
>>
>>> Julien Anguenot wrote:
>>>
>>>
>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>> Hash: SHA1
>>>>
>>>> I implemented a pre-commit hook on transaction supporting subscribers
>>>> within CPS for our indexation use case. (for ZODB-3.2.x on
>>>> Zope-2.7.x)
>>>
>>>
>>>
>>> Cool
>>>
>>>
>>>> if you're interested to take a look at it :
>>>>
>>>> http://lists.nuxeo.com/pipermail/cps-devel/2005-April/001357.html
>>>
>>>
>>>
>>> I get a traceback from viewcvs when I try to view the patch.
>>>
>>
>>
>> this one ? :
>>
>> http://cvs.nuxeo.org/cgi-bin/viewcvs.cgi/CPS3/CPSCore/PatchZODB.py?rev=1.1&view=auto
>>
>>
> 
> No, the one given in
> 
>   http://lists.nuxeo.com/pipermail/cps-devel/2005-April/001357.html
> 
> which is:
> 
>   http://cvs.nuxeo.org/cgi-bin/viewcvs.cgi/CPS3/CPSCore/PatchZODB.py
> 
> :)
> 
>>
>>>> The difference I can see with your proposal is the abort() hook
>>>> facility
>>>> that can be a good thing especially if the subscriber code has to
>>>> communicate with external programs for rollback purpose.
>>>
>>>
>>>
>>> I suggest that if you are going to "communicate with external
>>> programs for rollback purpose", it would be much better to
>>> participate as a data manager.
>>>
>>
>>
>> in ZODB-3.2 ? Can you explain ?
> 
> 
> In other words, implementing the interface that transactions
> expect of things like adtabase connections.  Unfortunately,
> this wasn't documented until recently.  In ZODB 3.3,
> transaction.interfaces has IDataManagerOriginal which attempts
> to document the ZODB 3.2 transaction-manager interface.
> 
> Unfortunately, the data manager interface for ZODB 3.3 isn't
> accurately documented yet.  (There's even a bonus inacurate
> interface. ;) Tim and I intend to fix this this week.
>

ok.

>>> I would say that the main difference is that with the simple hook
>>> facility I proposed, you can just register simple callables. You
>>> don't have to create a class.
>>
>>
>>
>> ok for this. My idea is to control what people are going to register. So
>> I'm adding constraints by providing an interface they need to implement
>> for their own subscribers. That's mostly the point.
> 
> 
> Are you saying that you don't want people to use this facility
> and you want to make them work harder in order to discourage them?
> 
> ;)
> 

It's more to simplify mine and avoid debug time, actually :) Believe me
I'm having my reasons for doing this even if I get your point...

<troll:funny>
  Java people coming to Python like having constraints at first ;)
</troll:funny>

	J.

- --
Julien Anguenot | Nuxeo R&D (Paris, France)
CPS Plateform : http://www.cps-project.org
mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFCUZWfGhoG8MxZ/pIRAgo/AJ9e9ALpAB5SHidH65f53ampgL4CogCeN2LH
4aRQeVoGdcAV0d6uuxXG/hw=
=TgN3
-----END PGP SIGNATURE-----


More information about the ZODB-Dev mailing list