--- mysql-connector-java-5.1.8/src/com/mysql/jdbc/jdbc2/optional/SuspendableXAConnection.java 2009-07-14 13:12:13.000000000 -0400 +++ /work/download/mysql-connector-java-5.1.8/src/com/mysql/jdbc/jdbc2/optional/SuspendableXAConnection.java 2009-08-25 13:29:30.000000000 -0400 @@ -75,6 +75,7 @@ if (conn == null) { conn = new MysqlXAConnection(connectionToWrap, connectionToWrap.getLogXaCommands()); + addXAConnectionMapping(xid,conn); } return conn; @@ -83,6 +84,10 @@ private static synchronized void removeXAConnectionMapping(Xid xid) { XIDS_TO_PHYSICAL_CONNECTIONS.remove(xid); } + + private static synchronized void addXAConnectionMapping(Xid xid,XAConnection conn) { + XIDS_TO_PHYSICAL_CONNECTIONS.put(xid,conn); + } private synchronized void switchToXid(Xid xid) throws XAException { if (xid == null) {