if (currentDbHandle.isValid())
if (currentDbHandle != null && currentDbHandle.isValid())
    private void findIscTrHandle(Xid xid, int flags)        throws GDSException, XAException    {        try        {            currentTr = mcf.getCurrentIscTrHandle(xid, this, flags);        }        catch (GDSException ge)        {            currentTr = null;            //All errors are fatal, kill the connection.            //First check if currentDbHandle is still ok, return if possible            if (currentDbHandle.isValid())            {                try                {                    mcf.returnDbHandle(currentDbHandle, cri);                }                catch (GDSException ge2)                {                    if (log!=null) log.debug("Another exception killing a dead connection", ge2);                } // end of try-catch            } // end of if ()            //Notify the connection manager.            ConnectionEvent ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, ge);            notify(connectionErrorOccurredNotifier, ce);            ge.setXAErrorCode(XAException.XAER_RMERR);            throw ge;        } // end of try-catch        if (currentTr.getDbHandle() != currentDbHandle)        {            try            {                mcf.returnDbHandle(currentDbHandle, cri);            }            catch (GDSException ge)            {                ge.setXAErrorCode(XAException.XAER_RMERR);                throw ge;            } // end of try-catch            currentDbHandle = currentTr.getDbHandle();        }    }