[GLASSFISH-19007] Missed query timeout while connection validation by table query Created: 16/Aug/12  Updated: 16/Aug/12

Status: Open
Project: glassfish
Component/s: jdbc
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: evgeniya Assignee: Shalini
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified



See please

protected void isValidByTableQuery(java.sql.Connection con, String tableName) throws ResourceException {
final String statement = "SELECT COUNT FROM " + tableName;
stmt = con.prepareStatement(statement);
rs = stmt.executeQuery();

It would be great to have query timeout here (with some default value, that can be changed, say, by some JVM option). (http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#setQueryTimeout(int))

Actually, we had server outage in our production because of lack of this timeout (see details here: http://perfstories.wordpress.com/2012/05/15/yet-another-hanging-java-net-socketinputstream-socketread0/)

Thank you,


Generated at Tue Nov 24 23:36:00 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.