Page 1 of 1

Database Disconnect Error

PostPosted: Mon Aug 27, 2012 7:09 pm
by fallingdown
Most of the time I leave my DB management tool, like DBeaver, open on my computer. Sometimes after a long period of time I get an error because the connection has been dropped or reset. Specifically, I get IO Error: Connection reset by peer: socket write error.

So I try to disconnect and reconnect, but when I try to disconnect, DBeaver throws me an error:

Error disconnecting from datasource "XYZ"
Not connected to database

So I'm in a situation where I need to disconnect within DBeaver, but I cannot because I'm not really connected in the first place. It's not a huge deal, since I just need to close DBeaver completely and restart, but it's a bit of an inconvenience. Be nice if DBeaver handled this scenario a little more gracefully. The other solution would be for me to be a little better disciplined and close out my connections when I'm done for the day...but I don't see that happening ;)

Windows 7 Enterprise
DBeaver 1.6.2 32-bit
Oracle 11r1

Re: Database Disconnect Error

PostPosted: Tue Aug 28, 2012 7:45 am
by Serge

It looks like a bug. BTW usually I just do "Invalidate connection" when connection was broken. But disconnect+connect should work too.

But I can't reproduce problem you described. Are there any messages in error log, probably a stacktrace? Could you provide steps to reproduce?


Re: Database Disconnect Error

PostPosted: Fri Nov 02, 2012 8:50 pm
by codebling
Is it possible to introduce an auto-reconnect feature? I have set auto-reconnect to true in the advanced settings of a MySQL connection, but it doesn't seem to work. This is especially annoying when you've already edited a value, since you have no choice but to discard all of your changes and disconnect in order to connect again.

Re: Database Disconnect Error

PostPosted: Fri Nov 02, 2012 9:23 pm
by Serge
What about "Invalidate/Reconect" function?
I believe it should help in such situation (it doesn't refresh any client side objects and do not reject changes).

Auto-reconnect is a feature of some JDBC drivers (e.g. MySQL) and it is not very obvious how it actually works (or should work).
Main problem for universal tool is how to determine that connection is actually broken. While it is realtively easy for some drivers, for others it is almost impossible (driver may screen original exception and say something like "internal error while executing statement").
So I think that manual Invalidate operation should be a best solution for this problem.

Re: Database Disconnect Error

PostPosted: Fri Nov 02, 2012 10:14 pm
by codebling

Re: Database Disconnect Error

PostPosted: Fri Nov 02, 2012 10:35 pm
by codebling
If invalidate/reconnect is implemented, it could be an option on the 'Data error' dialog, e.g. in addition to the 'OK' and 'Details' buttons, an 'reconnect&retry' button

Re: Database Disconnect Error

PostPosted: Sat Nov 03, 2012 2:31 pm
by Serge