Bug #29893 Connector/J hangs
Submitted: 19 Jul 2007 10:15 Modified: 20 Jul 2007 6:51
Reporter: Alex Ryzhov Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:5.1.0 OS:Windows (not checked on other OS)
Assigned to: CPU Architecture:Any

[19 Jul 2007 10:15] Alex Ryzhov
Description:
Connector/J hangs forever. If I enable Connector/J profiling, it hangs too (no dumps produced after query). 

How to repeat:
1) connect to mysqld running at localhost, URI "jdbc:mysql://localhost:<port>/<db>?user=<login>&password=<pass>" is ok.
2) stop mysqld
3) issue any query on the connection 

My environment:
- Windows XP
- mysql-5.0.41
- mysql-connector-java-5.1.0
- Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
[19 Jul 2007 14:36] Mark Matthews
Depending on when/how the socket dies, Connector/J won't "un-hang" until the TCP/IP stack reports back that the connection is dead, as it uses the default values for network-related timeouts that the Java class libraries provide. In some cases this can take up to 15 minutes or so, depending on your operating system.

If you need quicker detection of dead connections, you should set the socket timeout via the "socketTimeout" property.
[20 Jul 2007 5:59] Alex Ryzhov
socketTimeout was first thing I've tryed, with no effect.
I'll create as simple as possible test code and add it to the bug.
[20 Jul 2007 6:51] Alex Ryzhov
I found error in my test code. Please sorry. Not a bug.