[jbosscache-dev] Re: DummyTransaction and DumyTransactionManager

Jonathan Halliday jonathan.halliday at redhat.com
Thu Aug 23 06:09:14 EDT 2007


No, the status is determined before any of the 
afterCompletions run and does not change. An 
afterCompletions success/failure does not change the 
transaction outcome. They are in effect receiving 
notification of an earlier event and the notifications are 
independent, may happen in arbitrary order or even in 
parallel. Well, aside from the use of 
TransactionSynchronizationRegistry, but that's another story.

Jonathan.

Manik Surtani wrote:
> Ok, then the DummyTM's current behaviour of swallowing exceptions in 
> afterCompletion() is correct?
> 
> What about the status that gets passed into subsequent Syncs after an 
> exception is encountered?  I'd expect something like (pseudocode):
> 
> int status = getStatusFromBeforeCompletion();
> 
> for (Synchronization s : syncs)
> {
>     try
>     {
>         s.afterCompletion(status);
>     }
>     catch (Exception e)
>     {
>         log(e);
>         status = STATUS_UNKNOWN; // so subsequent Syncs get this status
>     }
> }

-- 
------------------------------------------------------------
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 
Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom.
Registered in UK and Wales under Company Registration No. 
3798903  Directors: Michael Cunningham (USA), Charlie Peters 
(USA) and David Owens (Ireland)



More information about the jbosscache-dev mailing list