aspose file tools*
The moose likes JDBC and the fly likes Connection Reset (Very Weird !) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connection Reset (Very Weird !) " Watch "Connection Reset (Very Weird !) " New topic
Author

Connection Reset (Very Weird !)

jay vas
Ranch Hand

Joined: Aug 30, 2005
Posts: 407
Hi Guys :

On startup of my computer, I can connect to my database server locally and also over the network (which has no other traffic other than my application).

However, I cant connect to it twice in a row !? The second time my app tries going to the database I get the Connection Refused exception :

answers ::: jdbc:mysql://155.37.101.106:3306/connjur
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: java.net.ConnectException: Connection refused

STACKTRACE:

java.net.SocketException: java.net.ConnectException: Connection refused at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)


The weird thing here is that after this, I cant even connect locally anymore
from the command line - mysql just lets out a beep and dies with the error
"Cant connect to LocalHost".

Is mysql shutting itself down within 1 minute of startup or something ???

Please help !
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

Sounds like you may have a single-connection limit and you're not closing the first connection.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
jay vas
Ranch Hand

Joined: Aug 30, 2005
Posts: 407
Thanks for the reply ! Well I can run multiple command line
instances of mysql at once, however...but is there a way to force mysql to close all connections from the command line to test youre idea ? Also, where is the connection limit defined... ?

-jay
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

Are you freeing the connection properly in your app?
jay vas
Ranch Hand

Joined: Aug 30, 2005
Posts: 407
Yeah I was. The problem was actually in MySql - something happened with the innodb tables and the config file. It turns out a simple reconfiguration of using the instance config wizard fixed it.

I think it was a bug in MySql.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connection Reset (Very Weird !)
 
Similar Threads
java.rmi.ConnectException
another JDBC driver question
Java Issue
Connecting with MySql
java.net.ConnectException: Connection refused: MYSQL