User: dmaplesden
Date: 01/11/29 18:34:29
Modified: src/main/org/jboss/resource/adapter/jdbc/local
StatementInPool.java JDBCManagedConnection.java
Log:
My punt at fixing our jdbc connection problems. I have done two things...
1) added a listener to shutdown the ConnectionInPool object(s) when the
managed connection goes to an error state.
2) prevented statement errors being propagated to the connection. The
connection will only go to an error state if its actual underlying connection
throws an exception.
Revision Changes Path
1.2 +7 -4
jbosscx/src/main/org/jboss/resource/adapter/jdbc/local/StatementInPool.java
Index: StatementInPool.java
===================================================================
RCS file:
/cvsroot/jboss/jbosscx/src/main/org/jboss/resource/adapter/jdbc/local/StatementInPool.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StatementInPool.java 2001/09/08 19:32:20 1.1
+++ StatementInPool.java 2001/11/30 02:34:28 1.2
@@ -56,10 +56,13 @@
*/
public void setError(SQLException e)
{
- if (con != null)
- {
- con.setError(e);
- }
+ // At this stage I don't think we want to put the connection into an error
state
+ // just because the statement has thrown an error.
+
+ //if (con != null)
+ //{
+ // con.setError(e);
+ //}
}
/**
1.2 +36 -1
jbosscx/src/main/org/jboss/resource/adapter/jdbc/local/JDBCManagedConnection.java
Index: JDBCManagedConnection.java
===================================================================
RCS file:
/cvsroot/jboss/jbosscx/src/main/org/jboss/resource/adapter/jdbc/local/JDBCManagedConnection.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JDBCManagedConnection.java 2001/09/08 19:32:20 1.1
+++ JDBCManagedConnection.java 2001/11/30 02:34:28 1.2
@@ -28,7 +28,7 @@
*
* @author Aaron Mulder <[EMAIL PROTECTED]>
* @author <a href="mailto:[EMAIL PROTECTED]">David Jencks</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class JDBCManagedConnection extends BaseManagedConnection
{
@@ -102,6 +102,41 @@
*/
public void objectUsed(PoolEvent evt)
{
+ }
+ });
+ this.addConnectionEventListener(
+ new javax.resource.spi.ConnectionEventListener()
+ {
+// public void enlist()
+// throws SystemException, RollbackException
+// {
+// }
+
+// public void register()
+// throws SystemException, RollbackException
+// {
+// }
+
+ public void localTransactionStarted(ConnectionEvent evt)
+ {
+ }
+
+ public void localTransactionCommitted(ConnectionEvent evt)
+ {
+ }
+
+ public void localTransactionRolledback(ConnectionEvent evt)
+ {
+ }
+
+ public void connectionErrorOccurred(javax.resource.spi.ConnectionEvent
evt)
+ {
+ wrapper.shutdown();
+ }
+
+ public void connectionClosed(javax.resource.spi.ConnectionEvent evt)
+ {
+ //no shutdown needed because managed conn is only closed after all
wrappers are closed.
}
});
return wrapper;
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development