[ZODB-Dev] Re: afterCommitHook on abort

2007-10-17 Thread Christian Zagrodnick

On 2007-09-18 14:21:55 +0200, Jim Fulton <[EMAIL PROTECTED]> said:



On Sep 18, 2007, at 6:50 AM, Christian Zagrodnick wrote:


On 2007-09-12 15:49:49 +0200, Julien Anguenot <[EMAIL PROTECTED]> said:


This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
Hi there,
Christian Zagrodnick wrote:

Any opinion about this?

I guess the documentation was a little bit ahead of the  implementation
at the time I did this.
Though, I think the after commit hooks  should be called  in the  abort()
method as well as it might be interesting, as I mentioned it in the
documentation, and as well to be consistent with the commit()  behavior.
Maybe cleaning up the documentation would be simpler if nobody needs
this feature right now.


Well, I'd need it, so I'll implement it, ok?


OK, but please make a proposal first.


I finally added the proposal: 
http://wiki.zope.org/ZODB/MakeTransactionHooksBehaveAsDocumented




--
Christian Zagrodnick

gocept gmbh & co. kg  ·  forsterstrasse 29 · 06112 halle/saale
www.gocept.com · fon. +49 345 12298894 · fax. +49 345 12298891



___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] Re: afterCommitHook on abort

2007-09-18 Thread Jim Fulton


On Sep 18, 2007, at 8:07 AM, Christian Zagrodnick wrote:


Hi

On 2007-09-18 12:50:05 +0200, Christian Zagrodnick <[EMAIL PROTECTED]>  
said:



On 2007-09-12 15:49:49 +0200, Julien Anguenot <[EMAIL PROTECTED]> said:

Hi there,
Christian Zagrodnick wrote:

Any opinion about this?
I guess the documentation was a little bit ahead of the  
implementation

at the time I did this.
Though, I think the after commit hooks  should be called  in the  
abort(

)

method as well as it might be interesting, as I mentioned it in the
documentation, and as well to be consistent with the commit()  
behavior.

Maybe cleaning up the documentation would be simpler if nobody needs
this feature right now.

Well, I'd need it, so I'll implement it, ok?


I put it into branches/zagy-after-commit


Please describe the proposed change to the API.

Jim

--
Jim Fulton  mailto:[EMAIL PROTECTED]Python 
Powered!
CTO (540) 361-1714  
http://www.python.org
Zope Corporationhttp://www.zope.com http://www.zope.org



___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] Re: afterCommitHook on abort

2007-09-18 Thread Jim Fulton


On Sep 18, 2007, at 6:50 AM, Christian Zagrodnick wrote:


On 2007-09-12 15:49:49 +0200, Julien Anguenot <[EMAIL PROTECTED]> said:


This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
Hi there,
Christian Zagrodnick wrote:

Any opinion about this?
I guess the documentation was a little bit ahead of the  
implementation

at the time I did this.
Though, I think the after commit hooks  should be called  in the  
abort()

method as well as it might be interesting, as I mentioned it in the
documentation, and as well to be consistent with the commit()  
behavior.

Maybe cleaning up the documentation would be simpler if nobody needs
this feature right now.


Well, I'd need it, so I'll implement it, ok?


OK, but please make a proposal first.

Jim

--
Jim Fulton  mailto:[EMAIL PROTECTED]Python 
Powered!
CTO (540) 361-1714  
http://www.python.org
Zope Corporationhttp://www.zope.com http://www.zope.org



___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


[ZODB-Dev] Re: afterCommitHook on abort

2007-09-18 Thread Christian Zagrodnick

Hi

On 2007-09-18 12:50:05 +0200, Christian Zagrodnick <[EMAIL PROTECTED]> said:


On 2007-09-12 15:49:49 +0200, Julien Anguenot <[EMAIL PROTECTED]> said:

Hi there,

Christian Zagrodnick wrote:

Any opinion about this?


I guess the documentation was a little bit ahead of the implementation
at the time I did this.

Though, I think the after commit hooks  should be called  in the abort(

)

method as well as it might be interesting, as I mentioned it in the
documentation, and as well to be consistent with the commit() behavior.

Maybe cleaning up the documentation would be simpler if nobody needs
this feature right now.


Well, I'd need it, so I'll implement it, ok?


I put it into branches/zagy-after-commit

Could somebody review it?

--
Christian Zagrodnick

gocept gmbh & co. kg  ·  forsterstrasse 29 · 06112 halle/saale
www.gocept.com · fon. +49 345 12298894 · fax. +49 345 12298891



___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


[ZODB-Dev] Re: afterCommitHook on abort

2007-09-18 Thread Christian Zagrodnick

On 2007-09-12 15:49:49 +0200, Julien Anguenot <[EMAIL PROTECTED]> said:


This is an OpenPGP/MIME signed message (RFC 2440 and 3156)

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)

Hi there,

Christian Zagrodnick wrote:

Any opinion about this?


I guess the documentation was a little bit ahead of the implementation
at the time I did this.

Though, I think the after commit hooks  should be called  in the abort()
method as well as it might be interesting, as I mentioned it in the
documentation, and as well to be consistent with the commit() behavior.

Maybe cleaning up the documentation would be simpler if nobody needs
this feature right now.


Well, I'd need it, so I'll implement it, ok?


=20
On 2007-08-30 15:48:53 +0200, Christian Zagrodnick <[EMAIL PROTECTED]> said=

:

=20

Hi,

the documentation in the _transaction.py reads:

After-commit hook
--

Sometimes, applications want to execute code after a transaction is
committed or aborted. [...] The callable will be called with a Boolean=



value representing the status of the commit operation as first
argument (true if successfull or false iff aborted) [...]

And indeed in the commit() method it reads:

try:
self._commitResources()
self.status =3D Status.COMMITTED
except:
t, v, tb =3D self._saveAndGetCommitishError()
self._callAfterCommitHooks(status=3DFalse)
raise t, v, tb
else:
if self._manager:
self._manager.free(self)
self._synchronizers.map(lambda s: s.afterCompletion(self))=



self._callAfterCommitHooks(status=3DTrue)


But in the abort() method the hooks are not called.

Is this intentional? If yes, the documentation should be adjusted to
reflect that the hooks are *only* called if there *is* a commit and it=



is *failing*.

If not the hooks should be called in abort (my favourite) :)



--
Christian Zagrodnick

gocept gmbh & co. kg  ·  forsterstrasse 29 · 06112 halle/saale
www.gocept.com · fon. +49 345 12298894 · fax. +49 345 12298891



___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] Re: afterCommitHook on abort

2007-09-12 Thread Jim Fulton


On Sep 12, 2007, at 9:49 AM, Julien Anguenot wrote:


Hi there,

Christian Zagrodnick wrote:

Any opinion about this?


I guess the documentation was a little bit ahead of the implementation
at the time I did this.

Though, I think the after commit hooks  should be called  in the  
abort()

method as well as it might be interesting, as I mentioned it in the
documentation, and as well to be consistent with the commit()  
behavior.


Maybe cleaning up the documentation would be simpler if nobody needs
this feature right now.


+1

Jim

--
Jim Fulton  mailto:[EMAIL PROTECTED]Python 
Powered!
CTO (540) 361-1714  
http://www.python.org
Zope Corporationhttp://www.zope.com http://www.zope.org



___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] Re: afterCommitHook on abort

2007-09-12 Thread Julien Anguenot
Hi there,

Christian Zagrodnick wrote:
> Any opinion about this?

I guess the documentation was a little bit ahead of the implementation
at the time I did this.

Though, I think the after commit hooks  should be called  in the abort()
method as well as it might be interesting, as I mentioned it in the
documentation, and as well to be consistent with the commit() behavior.

Maybe cleaning up the documentation would be simpler if nobody needs
this feature right now.

Cheers,

J.

> 
> On 2007-08-30 15:48:53 +0200, Christian Zagrodnick <[EMAIL PROTECTED]> said:
> 
>> Hi,
>>
>> the documentation in the _transaction.py reads:
>>
>> After-commit hook
>> --
>>
>> Sometimes, applications want to execute code after a transaction is
>> committed or aborted. [...] The callable will be called with a Boolean
>> value representing the status of the commit operation as first
>> argument (true if successfull or false iff aborted) [...]
>>
>> And indeed in the commit() method it reads:
>>
>> try:
>> self._commitResources()
>> self.status = Status.COMMITTED
>> except:
>> t, v, tb = self._saveAndGetCommitishError()
>> self._callAfterCommitHooks(status=False)
>> raise t, v, tb
>> else:
>> if self._manager:
>> self._manager.free(self)
>> self._synchronizers.map(lambda s: s.afterCompletion(self))
>> self._callAfterCommitHooks(status=True)
>>
>>
>> But in the abort() method the hooks are not called.
>>
>> Is this intentional? If yes, the documentation should be adjusted to
>> reflect that the hooks are *only* called if there *is* a commit and it
>> is *failing*.
>>
>> If not the hooks should be called in abort (my favourite) :)
>>
>>
>> Regards,
> 
> 


-- 
Julien Anguenot | Nuxeo R&D (Paris, France)
Open Source ECM - http://www.nuxeo.com
Nuxeo 5 : http://www.nuxeo.org
Mobile: +33 (0) 6 72 57 57 66



signature.asc
Description: OpenPGP digital signature
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


[ZODB-Dev] Re: afterCommitHook on abort

2007-09-04 Thread Christian Zagrodnick

Any opinion about this?


On 2007-08-30 15:48:53 +0200, Christian Zagrodnick <[EMAIL PROTECTED]> said:


Hi,

the documentation in the _transaction.py reads:

After-commit hook
--

Sometimes, applications want to execute code after a transaction is
committed or aborted. [...] The callable will be called with a Boolean
value representing the status of the commit operation as first
argument (true if successfull or false iff aborted) [...]

And indeed in the commit() method it reads:

try:
self._commitResources()
self.status = Status.COMMITTED
except:
t, v, tb = self._saveAndGetCommitishError()
self._callAfterCommitHooks(status=False)
raise t, v, tb
else:
if self._manager:
self._manager.free(self)
self._synchronizers.map(lambda s: s.afterCompletion(self))
self._callAfterCommitHooks(status=True)


But in the abort() method the hooks are not called.

Is this intentional? If yes, the documentation should be adjusted to 
reflect that the hooks are *only* called if there *is* a commit and it 
is *failing*.


If not the hooks should be called in abort (my favourite) :)


Regards,



--
Christian Zagrodnick

gocept gmbh & co. kg  ·  forsterstrasse 29 · 06112 halle/saale
www.gocept.com · fon. +49 345 12298894 · fax. +49 345 12298891



___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev