[jbosscache-dev] Re: DummyTransaction and DumyTransactionManager

Manik Surtani manik at jboss.org
Thu Aug 23 05:59:50 EDT 2007


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
	}
}


On 23 Aug 2007, at 09:43, Jonathan Halliday wrote:

> 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.
> _______________________________________________
> jbosscache-dev mailing list
> jbosscache-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jbosscache-dev

--
Manik Surtani

Lead, JBoss Cache
JBoss, a division of Red Hat






More information about the jbosscache-dev mailing list