Torsten Krah opened SPR-11590 and commented
Hi,
i've got a service A which registered a TransactionSynchronization to do stuff in the afterCommit() case.
It calls a service B to index things to lucene.
I've forgot that i did already leveraged the transaction handling to the lucene service B, so i did wonder why nothing happened and no error was thrown.
After debugging i've found that A did register a Synchronization (doAfterCommit) to call B, and B did also register one (doAfterCompletion).
The one which B registered was never called because doAfterCommit is the last trigger to be called and triggerAfterCompletion was already run.
Maybe a check can be added for addSynchronization(), that it throws an Exception, if the afterCompletion trigger is already reached - or at least a log warning would be nice.
Affects: 4.0.2
Issue Links: