tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bwnyasse <>
Subject The cause of the exception is lost with the implementation of TransactionRolledbackException#writeReplace
Date Fri, 28 Sep 2018 08:56:08 GMT
We are migrating from OpenEjb 4.5.0 to OpenEjb 7.x and We are facing a
regression in a test. 

The test is a simple scenario in which we store an entity and we expect to
have an exception like "MyExampleStoreException".

We used to loop into the retrieving throwable exception to check if our
exception is present like the following : 
			Throwable cause = e.getCause();
			while (cause.getCause() != null)
				cause = cause.getCause();
			Assert.assertTrue(cause instanceof MyExampleStoreException);/

The test is working great with OpenEjb 4.5.0. But We are noticed that this 
introduce the method #writeReplace , so now we will have a*
javax.transaction.TransactionRolledbackException* but no way to retrieve the
original cause. 

We are wondering if it is ok to not be able to retrieve the original cause
of the TransactionRolledbackException ? For now , we can check in the
message like this 


Any suggestion ? 


Sent from:

View raw message