User: mulder  
  Date: 00/06/09 08:11:15

  Modified:    src/main/org/jboss/minerva/xa XAConnectionImpl.java
  Log:
  Rollback JDBC1 connection wrapper after it was used without a current
  transaction.  Otherwise, it will keep any pending changes until the next
  time it's checked out of the pool.  When used with a transaction, the
  transaction will commit or rollback.
  
  Revision  Changes    Path
  1.2       +13 -1     jboss/src/main/org/jboss/minerva/xa/XAConnectionImpl.java
  
  Index: XAConnectionImpl.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/minerva/xa/XAConnectionImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XAConnectionImpl.java     2000/06/02 13:48:48     1.1
  +++ XAConnectionImpl.java     2000/06/09 15:11:14     1.2
  @@ -36,7 +36,7 @@
    * also register a TransactionListener that will be notified when the
    * Transaction is finished, and release the XAConnection at that time.</P>
    * @see org.jboss.minerva.xa.TransactionListener
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    * @author Aaron Mulder ([EMAIL PROTECTED])
    */
   public class XAConnectionImpl implements XAConnection {
  @@ -119,6 +119,18 @@
           Vector local = (Vector)listeners.clone();
           for(int i=local.size()-1; i>=0; i--)
               
((ConnectionEventListener)local.elementAt(i)).connectionErrorOccurred(new 
ConnectionEvent(this, e));
  +    }
  +
  +    /**
  +     * Rolls back the underlying connection.  This is used when there is no
  +     * current transaction and the connection is returned to the pool - since
  +     * no transaction will be committed or rolled back but this connection
  +     * will be reused, we must roll it back.
  +     */
  +    public void rollback() {
  +        try {
  +            con.rollback();
  +        } catch(SQLException e) {}
       }
   
       // ---- Implementation of javax.sql.XAConnection ----
  
  
  

Reply via email to