User: oleg    
  Date: 00/10/02 08:35:59

  Modified:    src/main/org/jboss/minerva/xa XAConnectionImpl.java
  Log:
  Exception handling impovement: don't let an induced exception to interrupt original 
exception handling.
  
  Revision  Changes    Path
  1.7       +10 -3     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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XAConnectionImpl.java     2000/09/29 15:48:37     1.6
  +++ XAConnectionImpl.java     2000/10/02 15:35:59     1.7
  @@ -43,7 +43,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.6 $
  + * @version $Revision: 1.7 $
    * @author Aaron Mulder ([EMAIL PROTECTED])
    */
   public class XAConnectionImpl implements XAConnection, PooledObject {
  @@ -147,8 +147,15 @@
        */
       public void setConnectionError(SQLException e) {
           Vector local = (Vector)listeners.clone();
  -        for(int i=local.size()-1; i>=0; i--)
  -            
((ConnectionEventListener)local.elementAt(i)).connectionErrorOccurred(new 
ConnectionEvent(this, e));
  +        for(int i=local.size()-1; i>=0; i--) {
  +            try {
  +                
((ConnectionEventListener)local.elementAt(i)).connectionErrorOccurred(new 
ConnectionEvent(this, e));
  +            } catch (RuntimeException ex) {
  +                // there can be thrown an induced exception,
  +                // but we must report to client the original one, right?
  +                ex.printStackTrace();
  +            }
  +        }
       }
   
       /**
  
  
  

Reply via email to