List of usage examples for javax.transaction.xa XAResource hashCode
@HotSpotIntrinsicCandidate public native int hashCode();
From source file:org.apache.synapse.commons.transaction.TranscationManger.java
public static void bindConnection(final Connection conn) throws Exception { long key = Thread.currentThread().getId(); try {/*from w w w .j ava 2 s . c o m*/ if (conn instanceof XAConnection) { Transaction tx = transactions.get().get(key); XAResource xaRes = ((XAConnection) conn).getXAResource(); if (!isXAResourceEnlisted(xaRes)) { tx.enlistResource(xaRes); addToEnlistedXADataSources(xaRes, key); log.debug(" DS enlisted in thread " + key + " XA Resource : " + xaRes.hashCode()); } } } catch (Exception ex) { StringBuilder logMsg = new StringBuilder(); Connection actual = ((javax.sql.PooledConnection) conn).getConnection(); logMsg.append(" Thread Id : " + key) .append(" BIND ERROR , Transaction Manager status : " + txManagers.get().get(key).getStatus()) .append("\n") .append(" BIND ERROR , Transaction status : " + transactions.get().get(key).getStatus()) .append("\n").append(" JDBC Connection status : " + actual.isClosed()).append("\n") .append(" BIND ERROR : " + ex); log.error(logMsg.toString()); rollbackTransaction(true, key); throw ex; } }