0

I am connecting to MySQL using the following connection string in JDBC.

jdbc:mysql://127.0.0.1/db?enable-named-pipe&socket=MySQL&socketFactory=com.mysql.jdbc.NamedPipeSocketFactory&zeroDateTimeBehavior=convertToNull

If i use a tcp/ip connection i can close the connection fine but it seems if i use a local socket/pipe connection to MySQL it throws the following exception.

java.netSocketException: Socket is not connected

Seems like the connection is being dropped without me needing to close the connection, so when using a local socket/pipe i don't have to close the connection it is done automatically, am i correct in thinking this? The data i have inserted seems to have gone in fine.

Thanks.

2
  • What is the question? If you think you are doing nothing wrong, I'd suggest filing a bug report with MySQL. Commented Feb 13, 2013 at 10:39
  • Can you delete the the main program context from Run configuration and Run it again. Commented Feb 13, 2013 at 10:40

2 Answers 2

1

It seems to be due to a JVM bug that hasn't been fixed yet http://bugs.mysql.com/bug.php?id=62518

Sign up to request clarification or add additional context in comments.

Comments

0

You know that you have not closed the connection and that you should.

For peace of mind, you may try to close the connection anyway and catch the thrown exception. This may be better than to rely on some kind of bug kind of feature that may go away in the next minor release.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.