keyedCallbacks = null;
   public void commit() throws Exception   {      if (state == STATE_ROLLBACK_ONLY)      {         throw new TransactionException("Transaction marked rollback only, cannot commit");      }      if (trace) { log.trace("executing before commit hooks " + this); }             boolean onePhase = state != STATE_PREPARED;            Iterator iter = callbacks.iterator();            while (iter.hasNext())      {         TxCallback callback = (TxCallback)iter.next();                  callback.beforeCommit(onePhase);      }            state = STATE_COMMITTED;            if (trace) { log.trace("committed " + this); }            iter = callbacks.iterator();            if (trace) { log.trace("executing after commit hooks " + this); }            while (iter.hasNext())      {         TxCallback callback = (TxCallback)iter.next();                  callback.afterCommit(onePhase);      }            callbacks = null;            keyedCallbackMap = null;                  if (trace) { log.trace("commit process complete " + this); }   }