if (flags == TMNOFLAGS && this.currentTxID instanceof LocalTxXid)
if (flags == TMNOFLAGS && sessionState.getCurrentTxId() instanceof LocalTxXid)
   public void start(Xid xid, int flags) throws XAException   {      if (log.isTraceEnabled())         log.trace("Start xid=" + xid + ", flags=" + flags + " " + this);      boolean convertTx = false;            if (this.currentTxID != null)      {         if (flags == TMNOFLAGS && this.currentTxID instanceof LocalTxXid)         {            convertTx = true;         }         else         {            //This resource is already doing work as part of another global tx            throw new XAException(XAException.XAER_OUTSIDE);         }      }      synchronized (this)      {         switch (flags)         {            case TMNOFLAGS :               if (convertTx)               {                  // it was an anonymous TX, TM is now taking control over it.                  // convert it over to a normal XID tansaction.                                    //Is it legal to "convert" a tx?                  //Surely only work done between start and end is considered part of the tx?                  //Is it legal to consider work done before "start" as part of the tx?                                                      setCurrentTransactionId(rm.convertTx((LocalTxXid)this.currentTxID, xid));               }               else               {                                    setCurrentTransactionId(rm.startTx(xid));                                }               break;            case TMJOIN :               setCurrentTransactionId(rm.joinTx(xid));               break;            case TMRESUME :               setCurrentTransactionId(rm.resumeTx(xid));               break;         }      }   }