[jboss-user] [Datasource Configuration] - I found a bug in JBoss JDBC WrappedConnection
Hatter Jiang
do-not-reply at jboss.com
Sat Feb 4 08:12:23 EST 2012
Hatter Jiang [https://community.jboss.org/people/hatterjiang] created the discussion
"I found a bug in JBoss JDBC WrappedConnection"
To view the discussion, visit: https://community.jboss.org/message/714438#714438
--------------------------------------------------------------
I'm a chinese user of JBoss 4.0.5GA.
We use JBoss JDBC connection pool connect to MySQL database, and we use MySQL proxy, before the MySQL proxy we use F5 as load balancer, as the attachment shows.
In normal status, client use F5(Master) connection to the MySQL proxy, but some times F5(Master) will switch to Slave, and the long time connection will be abandon.
Then we found, some times the JBoss JDBC connection pool cannot automatic recovery from this erorr, some times can.
After debug, we found these code:
public PreparedStatement prepareStatement(String sql) throws SQLException
{
checkTransaction();
try
{
return new WrappedPreparedStatement(this, mc.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY));
}
catch (Throwable t)
{
throw checkException(t);
}
}
We find when "checkTransaction();" cause Exception, MySQL JDBC connection will be mark as closed, but JBoss JDBC WrappedConnection wont mark it as closed, so this connection is aways in the connection pool, but cannot execute any SQL, because the real status of the connection is closed.
We replace "checkTransaction();" into the try block, and redo the test, it seems OK.
I also view the latest 7.0.1 CR1b version of JBoss, this problem is not resolved.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/714438#714438]
Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120204/98612185/attachment-0001.html
More information about the jboss-user
mailing list