isc_db_handle db = mc.getIscDBHandle(waitingToClose); tr = gds.get_new_isc_tr_handle();
    isc_tr_handle getCurrentIscTrHandle(Xid xid, FBManagedConnection mc, int flags)         throws XAException     {        isc_tr_handle tr = getTrHandleForXid(xid);        if (tr == null) {            if (flags != XAResource.TMNOFLAGS) {                throw new XAException("Transaction flags wrong, this xid new for this rm");            }            //new xid for us            try             {                isc_db_handle db = mc.getIscDBHandle(waitingToClose);                tr = gds.get_new_isc_tr_handle();                gds.isc_start_transaction(tr, db, mc.getTpb().getArray());            }            catch (GDSException ge) {                throw new XAException(ge.getMessage());            }            xidMap.put(xid, tr);        }        else {            if (flags != XAResource.TMJOIN && flags != XAResource.TMRESUME) {                throw new XAException("Transaction flags wrong, this xid already known");            }        }        return tr;    }