User: mulder  
  Date: 00/08/31 11:23:37

  Modified:    src/main/org/jboss/minerva/xa XAResourceImpl.java
  Log:
  During a "forget" operation:
  
  If the Xid is for the wrong transaction, throw an XAException immediately.
  Otherwise, send the transaction failed notification.
  Don't throw any other XAExceptions until after that so the notification
  will go through and the connection will be removed from the pool.
  
  The XAER_PROTO error probably shouldn't be thrown here at all, in the long
  run, but we'll take this one step at a time.
  
  Revision  Changes    Path
  1.5       +3 -3      jboss/src/main/org/jboss/minerva/xa/XAResourceImpl.java
  
  Index: XAResourceImpl.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/minerva/xa/XAResourceImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XAResourceImpl.java       2000/08/31 17:28:49     1.4
  +++ XAResourceImpl.java       2000/08/31 18:23:37     1.5
  @@ -22,7 +22,7 @@
    * <P><FONT COLOR="RED"><B>Warning:</B></FONT></P> This implementation assumes
    * that forget will be called after a failed commit or rollback.  Otherwise,
    * the database connection will never be closed.</P>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    * @author Aaron Mulder ([EMAIL PROTECTED])
    */
   public class XAResourceImpl implements XAResource {
  @@ -132,12 +132,12 @@
        *     transaction ID is wrong.
        */
       public void forget(Xid id) throws javax.transaction.xa.XAException {
  -        if(active) // End was not called!
  -            throw new XAException(XAException.XAER_PROTO);
           if(current == null || !id.equals(current))
               throw new XAException(XAException.XAER_NOTA);
           current = null;
           xaCon.transactionFailed();
  +        if(active) // End was not called!
  +            throw new XAException(XAException.XAER_PROTO);
       }
   
       /**
  
  
  

Reply via email to