I'm using Tranql 1.4 with Tranql Postgresql Connector 1.1 and Geronimo 2.0.1 with Spring.
When a SQLException occurs a NullPointerException when ManagedConnectionHandle.connectionError is invoked (here
the method executeBatch fail with an SQLException ) :
java.lang.NullPointerException
at org.tranql.connector.jdbc.ConnectionHandle.connectionError(ConnectionHandle.java:103)
at org.tranql.connector.jdbc.StatementHandle.executeBatch(StatementHandle.java:159)
...
The following is the stacktrace caught in debug mode when setAssociation is called. Here setAssociation
is called with null.
ConnectionHandle.setAssociation(ManagedConnectionHandle) line: 81
ManagedXAConnection(AbstractManagedConnection).dissociateConnections() line: 93
ManagedXAConnection(AbstractManagedConnection).destroy() line: 70
MCFConnectionInterceptor.returnConnection(ConnectionInfo, ConnectionReturnAction) line: 68
LocalXAResourceInsertionInterceptor.returnConnection(ConnectionInfo, ConnectionReturnAction) line: 50
SinglePoolConnectionInterceptor.internalReturn(ConnectionInfo, ConnectionReturnAction) line: 168
SinglePoolConnectionInterceptor(AbstractSinglePoolConnectionInterceptor).returnConnection(ConnectionInfo, ConnectionReturnAction) line: 123
TransactionEnlistingInterceptor.returnConnection(ConnectionInfo, ConnectionReturnAction) line: 95
TransactionCachingInterceptor.returnConnection(ConnectionInfo, ConnectionReturnAction) line: 106
ConnectionHandleInterceptor.returnConnection(ConnectionInfo, ConnectionReturnAction) line: 71
TCCLInterceptor.returnConnection(ConnectionInfo, ConnectionReturnAction) line: 50
ConnectionTrackingInterceptor.returnConnection(ConnectionInfo, ConnectionReturnAction) line: 91
GeronimoConnectionEventListener.connectionErrorOccurred(ConnectionEvent) line: 94
ManagedXAConnection(AbstractManagedConnection).unfilteredConnectionError(Exception) line: 120
ManagedXAConnection.access$000(ManagedXAConnection, Exception) line: 41
ManagedXAConnection$1.connectionErrorOccurred(ConnectionEvent) line: 62
PGXAConnection(AbstractJdbc23PooledConnection).fireConnectionFatalError(SQLException) line: 189
PGXAConnection(AbstractJdbc23PooledConnection).fireConnectionError(SQLException) line: 236
AbstractJdbc23PooledConnection.access$200(AbstractJdbc23PooledConnection, SQLException) line: 30
AbstractJdbc23PooledConnection$StatementHandler.invoke(Object, Method, Object[]) line: 475
$Proxy40.executeBatch() line: not available
PreparedStatementHandle(StatementHandle).executeBatch() line: 157
The executeBatch throws an SQLException, the consequence is that ConnectionHandle.setAssociation is called with
null. But the executeBatch call in StatementHandle is wrapped with a try/catch clause. In the catch clause
the ConnectionHandle.connectionError method is invoked, but because of the dissocation the
ManagedConnectionHandle is null causing a NullPointerException.
Finally the original SQLException is not available.
Do you know a solution ?
Is it a tranql Bug or an incompatibility between Tranql and Geronimo connector, or a bad practice ?
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
|