Issue Details (XML | Word | Printable)

Key: GLASSFISH-19007
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Shalini
Reporter: evgeniya
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
glassfish

Missed query timeout while connection validation by table query

Created: 16/Aug/12 09:34 AM   Updated: 16/Aug/12 05:20 PM
Component/s: jdbc
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Tags:
Participants: evgeniya and Shalini


 Description  « Hide

Hi,

See please
http://java.net/projects/glassfish/sources/svn/content/trunk/main/appserver/jdbc/jdbc-ra/jdbc-core/src/main/java/com/sun/gjc/spi/ManagedConnectionFactory.java?rev=53670:

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,

Evgeniya



kumara made changes - 16/Aug/12 05:20 PM
Field Original Value New Value
Assignee shreedhar_ganapathy [ shreedhar_ganapathy ] Shalini [ sm157516 ]
Component/s jdbc [ 10603 ]