synchronized (tranState) {
// global transaction is over.
tranState.associationState = XATransactionState.TC_COMPLETED;
tranState.notifyAll();
EmbedConnection conn = tranState.conn;
// already set in its own resource
// or can it be returned to its original resource?
if ((tranState.creatingResource.con.realConnection == conn) ||
(tranState.creatingResource.con.realConnection == null)) {
tranState.creatingResource.con.realConnection = conn;
BrokeredConnection handle =
tranState.creatingResource.con.currentConnectionHandle;
conn.setApplicationConnection(handle);
if (handle != null) {
try {
handle.setState(true);
} catch (SQLException sqle) {