Atomikos Forum |
|
It looks like this has been an outstanding item for quite some time now... Is there anything in the works to resolve the issue described in:
default82df.html?community.6.2509.2
One possible solution to this is to allow a RuntimeException handler to be set/registered on the com.atomikos.jdbc.AtomikosDataSourceBean. If it's not set resort to the current logging mechanism, other wise make a call to the handler.
For example: public interface TransactionStateExceptionHandler { public void handle(RuntimeException e); } abstract class TransactionStateHandler implements SubTxAwareParticipant { ... protected void commit() throws SysException, IllegalStateException, RollbackException { ... sync = (Synchronization)enumm.nextElement(); try { sync.beforeCompletion(); } catch (RuntimeException error) { setRollbackOnly(); if (this.exh_ != null) { exh_.handle(error); } else { LOGGER.logWarning("Unexpected error in beforeCompletion: ", error); } } ... } ... } This would allow the following configuration using Spring: <bean id="dataSource" class="com.atomikos.jdbc.AtomikosDataSourceBean" destroy-method="close" depends-on="dbProperties"> <property name="xaProperties" ref="dbProperties" /> <property name="minPoolSize" value="2" /> <property name="maxPoolSize" value="50" /> <property name="xaDataSourceClassName" value="org.h2.jdbcx.JdbcDataSource" /> <property name="UniqueResourceName" value="jdbc/myDS" /> <property name="testQuery" value="SELECT 1 and SELECT 1 FROM DUAL" /> <property name="transactionStateExceptionHandler" value="com.example.MyTransactionStateExceptionHandlerImpl" /> </bean> Thoughts? |