[jboss-cvs] JBossAS SVN: r105056 - branches/JBPAPP_5_0/connector/src/main/org/jboss/resource/adapter/jdbc.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu May 20 09:57:26 EDT 2010
Author: jesper.pedersen
Date: 2010-05-20 09:57:26 -0400 (Thu, 20 May 2010)
New Revision: 105056
Modified:
branches/JBPAPP_5_0/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnectionFactory.java
Log:
[JBPAPP-4357] isStaleConnection create a new class for each invocation
Modified: branches/JBPAPP_5_0/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnectionFactory.java
===================================================================
--- branches/JBPAPP_5_0/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnectionFactory.java 2010-05-20 13:53:13 UTC (rev 105055)
+++ branches/JBPAPP_5_0/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnectionFactory.java 2010-05-20 13:57:26 UTC (rev 105056)
@@ -588,36 +588,27 @@
boolean isStaleConnection(SQLException e)
{
- boolean isStale = false;
+ if (staleConnectionChecker != null)
+ return staleConnectionChecker.isStaleConnection(e);
- if(staleConnectionChecker != null)
+ if (staleConnectionCheckerClassName != null)
{
-
- isStale = staleConnectionChecker.isStaleConnection(e);
-
- }
-
- if(staleConnectionCheckerClassName != null)
- {
-
try
{
-
ClassLoader cl = Thread.currentThread().getContextClassLoader();
Class clazz = cl.loadClass(staleConnectionCheckerClassName);
staleConnectionChecker = (StaleConnectionChecker)clazz.newInstance();
- isStale = staleConnectionChecker.isStaleConnection(e);
+ return staleConnectionChecker.isStaleConnection(e);
- }catch (Exception ex2)
+ }
+ catch (Exception ex2)
{
log.warn("exception trying to create stale connection checker (disabling)" + staleConnectionCheckerClassName, ex2);
staleConnectionChecker = new NullStaleConnectionChecker();
-
}
-
}
- return isStale;
+ return false;
}
More information about the jboss-cvs-commits
mailing list