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) {
// couldn't reset the connection
closeUnusedConnection(tranState.conn);
tranState.creatingResource.con.realConnection = null;