afterCommitHook not called on abort
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ZODB |
Invalid
|
Medium
|
Christian Zagrodnick |
Bug Description
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:
except:
t, v, tb = self._saveAndGe
raise t, v, tb
else:
if self._manager:
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) :)
Changed in zodb: | |
status: | New → Confirmed |
Changed in zodb: | |
importance: | Undecided → Medium |
status: | In Progress → Incomplete |
Zagy's been implementing this for 3.9 (trunk) on a branch. It needs to be discussed whether we can backport to 3.8.