[jboss-cvs] JBossAS SVN: r105425 - in branches/JBPAPP_5_1/connector/src: main/org/jboss/resource/adapter/jdbc/vendor and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon May 31 16:18:39 EDT 2010
Author: fnasser at redhat.com
Date: 2010-05-31 16:18:39 -0400 (Mon, 31 May 2010)
New Revision: 105425
Modified:
branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnection.java
branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnectionFactory.java
branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/vendor/OracleExceptionSorter.java
branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/vendor/OracleValidConnectionChecker.java
branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/metadata/mcf/DataSourceDeploymentMetaData.java
branches/JBPAPP_5_1/connector/src/resources/dtd/jboss-ds_1_5.dtd
branches/JBPAPP_5_1/connector/src/resources/dtd/jboss-ds_5_0.dtd
Log:
merge to r105057 ; [JBPAPP-4354] New error codes for OracleExceptionSorter ; [JBPAPP-4358] Wrong timeout in OracleValidationChecker ; [JBPAPP-4357] isStaleConnection create a new class for each invocation ; [JBPAPP-4356] use-try-lock is ignored
Modified: branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnection.java
===================================================================
--- branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnection.java 2010-05-31 20:13:03 UTC (rev 105424)
+++ branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnection.java 2010-05-31 20:18:39 UTC (rev 105425)
@@ -255,7 +255,7 @@
protected void tryLock() throws SQLException
{
- int tryLock = mcf.getUseTryLock();
+ int tryLock = mcf.getUseTryLock().intValue();
if (tryLock <= 0)
{
lock();
@@ -268,6 +268,7 @@
}
catch (InterruptedException e)
{
+ Thread.currentThread().interrupt();
throw new SQLException("Interrupted attempting lock: " + this);
}
}
Modified: branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnectionFactory.java
===================================================================
--- branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnectionFactory.java 2010-05-31 20:13:03 UTC (rev 105424)
+++ branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnectionFactory.java 2010-05-31 20:18:39 UTC (rev 105425)
@@ -144,7 +144,7 @@
private boolean validateOnMatch = true;
/** Whether to use a try lock */
- private int useTryLock = 60;
+ private Integer useTryLock = Integer.valueOf(60);
public BaseWrapperManagedConnectionFactory ()
{
@@ -365,7 +365,7 @@
*
* @return the useTryLock.
*/
- public int getUseTryLock()
+ public Integer getUseTryLock()
{
return useTryLock;
}
@@ -375,7 +375,7 @@
*
* @param useTryLock the useTryLock.
*/
- public void setUseTryLock(int useTryLock)
+ public void setUseTryLock(Integer useTryLock)
{
this.useTryLock = useTryLock;
}
@@ -588,36 +588,26 @@
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);
-
- }catch (Exception ex2)
+ return staleConnectionChecker.isStaleConnection(e);
+ }
+ catch (Exception ex2)
{
log.warn("exception trying to create stale connection checker (disabling)" + staleConnectionCheckerClassName, ex2);
staleConnectionChecker = new NullStaleConnectionChecker();
-
}
-
}
- return isStale;
+ return false;
}
Modified: branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/vendor/OracleExceptionSorter.java
===================================================================
--- branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/vendor/OracleExceptionSorter.java 2010-05-31 20:13:03 UTC (rev 105424)
+++ branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/vendor/OracleExceptionSorter.java 2010-05-31 20:18:39 UTC (rev 105425)
@@ -67,7 +67,10 @@
|| ( error_code == 3114 ) //not connected to ORACLE
|| ( error_code >= 12100 && error_code <= 12299 ) // TNS issues
|| ( error_code == 17002) //connection reset
- || ( error_code == 17008 ) ) //connection closed
+ || ( error_code == 17008) //connection closed
+ || ( error_code == 17410) //No more data to read from socket
+ || ( error_code == 17447) //OALL8 is in an inconsistent state
+ )
{
return true;
}
Modified: branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/vendor/OracleValidConnectionChecker.java
===================================================================
--- branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/vendor/OracleValidConnectionChecker.java 2010-05-31 20:13:03 UTC (rev 105424)
+++ branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/jdbc/vendor/OracleValidConnectionChecker.java 2010-05-31 20:18:39 UTC (rev 105425)
@@ -46,8 +46,8 @@
private static transient Logger log;
- // The timeout (apparently the timeout is ignored?)
- private static Object[] params = new Object[] { new Integer(5000) };
+ // The timeout in seconds (apparently the timeout is ignored?)
+ private static Object[] params = new Object[] { new Integer(5) };
private transient Method ping;
Modified: branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/metadata/mcf/DataSourceDeploymentMetaData.java
===================================================================
--- branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/metadata/mcf/DataSourceDeploymentMetaData.java 2010-05-31 20:13:03 UTC (rev 105424)
+++ branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/metadata/mcf/DataSourceDeploymentMetaData.java 2010-05-31 20:18:39 UTC (rev 105425)
@@ -96,7 +96,7 @@
private int queryTimeout;
@XmlElement(name="use-try-lock")
- private long useTryLock;
+ private Integer useTryLock;
@XmlElement(name="url-delimiter")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@@ -267,12 +267,12 @@
@ManagementProperty(name="use-try-lock", description="The internal lock timeout",
includeInTemplate=true)
- public long getUseTryLock()
+ public Integer getUseTryLock()
{
return useTryLock;
}
- public void setUseTryLock(long useTryLock)
+ public void setUseTryLock(Integer useTryLock)
{
this.useTryLock = useTryLock;
}
@@ -429,7 +429,7 @@
property = new ManagedConnectionFactoryPropertyMetaData();
property.setName("UseTryLock");
- property.setType("long");
+ property.setType("java.lang.Integer");
property.setValue(String.valueOf(getUseTryLock()));
properties.add(property);
Modified: branches/JBPAPP_5_1/connector/src/resources/dtd/jboss-ds_1_5.dtd
===================================================================
--- branches/JBPAPP_5_1/connector/src/resources/dtd/jboss-ds_1_5.dtd 2010-05-31 20:13:03 UTC (rev 105424)
+++ branches/JBPAPP_5_1/connector/src/resources/dtd/jboss-ds_1_5.dtd 2010-05-31 20:18:39 UTC (rev 105425)
@@ -362,11 +362,11 @@
-->
<!ELEMENT query-timeout (#PCDATA)>
-<!-- Any configured timeout for internal locks on the resource adapter objects in milli-seconds
+<!-- Any configured timeout for internal locks on the resource adapter objects in seconds
The default is a 60 second timeout
e.g. 5 minutes
- <use-try-lock>300000</use-try-lock>
+ <use-try-lock>300</use-try-lock>
-->
<!ELEMENT use-try-lock (#PCDATA)>
Modified: branches/JBPAPP_5_1/connector/src/resources/dtd/jboss-ds_5_0.dtd
===================================================================
--- branches/JBPAPP_5_1/connector/src/resources/dtd/jboss-ds_5_0.dtd 2010-05-31 20:13:03 UTC (rev 105424)
+++ branches/JBPAPP_5_1/connector/src/resources/dtd/jboss-ds_5_0.dtd 2010-05-31 20:18:39 UTC (rev 105425)
@@ -380,11 +380,11 @@
-->
<!ELEMENT query-timeout (#PCDATA)>
-<!-- Any configured timeout for internal locks on the resource adapter objects in milli-seconds
+<!-- Any configured timeout for internal locks on the resource adapter objects in seconds
The default is a 60 second timeout
e.g. 5 minutes
- <use-try-lock>300000</use-try-lock>
+ <use-try-lock>300</use-try-lock>
-->
<!ELEMENT use-try-lock (#PCDATA)>
More information about the jboss-cvs-commits
mailing list