code: public void commit(Xid xid, boolean onePhase) throws XAException
      {
          if (tc.isEntryEnabled()) Tr.entry(tc, "commit", new Object[] {xid, onePhase});
  
  		final JCATranWrapper txWrapper;
  		
  		try
  		{
  			validateXid(xid);
  			
  			// Get the wrapper adding an association in the process
  			txWrapper = getTxWrapper(xid, true);
  		}
  		catch (XAException e)
  		{
  			if (tc.isEntryEnabled()) Tr.exit(tc, "commit", "caught XAException: " + XAReturnCodeHelper.convertXACode(e.errorCode));
  			throw e;
  		}
  
  		try
  		{
  			if (onePhase)
  			{
  				// Perform one-phase commit
  				txWrapper.commitOnePhase();
  			}
  			else
  			{
  				// Perform ordinary commit (prepare has already been called)
  				txWrapper.commit();
  			}
  		}
  		catch (XAException e)
  		{
  			TxExecutionContextHandler.removeAssociation(txWrapper);
  			
  			if (tc.isEntryEnabled()) Tr.exit(tc, "commit", "rethrowing XAException: " + XAReturnCodeHelper.convertXACode(e.errorCode));
  			throw e;
  		}
  
  		TxExecutionContextHandler.removeAssociation(txWrapper);
  
  		if (tc.isEntryEnabled()) Tr.exit(tc, "commit");
      }
docs: /* (non-Javadoc)
  @see javax.resource.spi.XATerminator#commit(javax.transaction.xa.Xid, boolean)