[jboss-cvs] JBossAS SVN: r64803 - branches/Branch_4_2/connector/src/main/org/jboss/resource/adapter/jms/inflow.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Aug 23 09:48:56 EDT 2007


Author: adrian at jboss.org
Date: 2007-08-23 09:48:56 -0400 (Thu, 23 Aug 2007)
New Revision: 64803

Modified:
   branches/Branch_4_2/connector/src/main/org/jboss/resource/adapter/jms/inflow/JmsActivation.java
Log:
[JBAS-4625] - Close the connection if we fail to setup the connection

Modified: branches/Branch_4_2/connector/src/main/org/jboss/resource/adapter/jms/inflow/JmsActivation.java
===================================================================
--- branches/Branch_4_2/connector/src/main/org/jboss/resource/adapter/jms/inflow/JmsActivation.java	2007-08-23 13:24:05 UTC (rev 64802)
+++ branches/Branch_4_2/connector/src/main/org/jboss/resource/adapter/jms/inflow/JmsActivation.java	2007-08-23 13:48:56 UTC (rev 64803)
@@ -456,11 +456,28 @@
          else
             result = qcf.createQueueConnection();
       }
-      if (clientID != null)
-         result.setClientID(clientID);
-      result.setExceptionListener(this);
-      log.debug("Using queue connection " + result);
-      return result;
+      try
+      {
+         if (clientID != null)
+            result.setClientID(clientID);
+         result.setExceptionListener(this);
+         log.debug("Using queue connection " + result);
+         return result;
+      }
+      catch (Throwable t)
+      {
+         try
+         {
+            result.close();
+         }
+         catch (Exception e)
+         {
+            log.trace("Ignored error closing connection", e);
+         }
+         if (t instanceof Exception)
+            throw (Exception) t;
+         throw new RuntimeException("Error configuring connection", t);
+      }
    }
    
    /**




More information about the jboss-cvs-commits mailing list