[jbosscache-dev] Re: DummyTransaction and DumyTransactionManager

Jonathan Halliday jonathan.halliday at redhat.com
Thu Aug 23 04:43:10 EDT 2007


Manik Surtani wrote:
> WRT JBCACHE-1167 I'm writing a test to create this situation where JBC's 
> Sync is called with a STATUS_UKNOWN and I notice that the 
> OrderedSynchronizationHandler and DummyTransaction in JBoss Cache 
> swallow any exceptions in afterCompletion(), simply logging the outcome.
> 
> See 
> http://fisheye.jboss.org/browse/JBossCache/core/tags/JBossCache_1_4_1_SP4/src/org/jboss/cache/transaction/DummyTransaction.java?r=1566 
> 
> 
> Lines 269 - 274.
> 
> Makes unit testing pretty tough if the TM swallows the failure here.  ;)
> 
> Jonathan, how does JBossTS behave (or how should any TM behave) at this 
> stage?  I'm assuming keep the exception, set status to STATUS_UNKNOWN 
> for the remaining syncs, and then throw the exception?

If an afterCompletion throws an Exception the TS continues 
regardless, since all Synchronizations should be invoked. 
What the client sees is determined by the transaction 
outcome, not the behaviour of the afterCompletion syncs. The 
client will get an exception only if the beforeCompletion or 
XARresources misbehave, not it the afterCompletions do.

Jonathan.



More information about the jbosscache-dev mailing list