Quantcast

MariaDB connections start failing after idle and won't reconnect

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

MariaDB connections start failing after idle and won't reconnect

KARR, DAVID (ATTSI)
I'm connecting to a MariaDB database.  The app running in Tomcat that uses the database is now setting "testWhileIdle" and "testOnReturn" to true, because the connections seem to time out after a while of being idle.  Those appear to mitigate the problem in the app itself.

In SQuirreL, if I leave a connection open for a while, I get similar errors like:
----------
        Error: (conn:121) Could not read packet: unexpected end of stream, read 0 bytes from 4
---------

It's not clear to me how to configure the connection automatically to mitigate these problems.

What's even worse is that when I try to "Reconnect", it just fails with "Error: (conn:121) Connection is close".  I actually have to completely close the connection and reopen it, and then it works until I go idle again.

What can I do to mitigate these problems in SQuirreL?

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Squirrel-sql-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MariaDB connections start failing after idle and won't reconnect

Gerd Wagner-3
Here's another trial to answer a question you haven't already found out
yourself.
I was a bit busy lately and am going through several mails now. Sorry.

Am 26.04.2017 um 21:48 schrieb KARR, DAVID:

> I'm connecting to a MariaDB database.  The app running in Tomcat that
> uses the database is now setting "testWhileIdle" and "testOnReturn"
> to true, because the connections seem to time out after a while of
> being idle.  Those appear to mitigate the problem in the app itself.
>
> In SQuirreL, if I leave a connection open for a while, I get similar
> errors like: ---------- Error: (conn:121) Could not read packet:
> unexpected end of stream, read 0 bytes from 4 ---------
>
> It's not clear to me how to configure the connection automatically to
> mitigate these problems.
>
> What's even worse is that when I try to "Reconnect", it just fails
> with "Error: (conn:121) Connection is close".  I actually have to
> completely close the connection and reopen it, and then it works
> until I go idle again.
>
> What can I do to mitigate these problems in SQuirreL?

Right click your Alias -> Alias properties -> Tab 'Connection'. The SQL
entered there will be executed periodically with configurable repeat time.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Squirrel-sql-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MariaDB connections start failing after idle and won't reconnect

KARR, DAVID (ATTSI)
> -----Original Message-----
> From: Gerd Wagner [mailto:[hidden email]]
> Sent: Saturday, April 29, 2017 4:21 AM
> To: KARR, DAVID <[hidden email]>; squirrel-sql-
> [hidden email]
> Subject: Re: [Squirrel-sql-users] MariaDB connections start failing
> after idle and won't reconnect
>
> Here's another trial to answer a question you haven't already found out
> yourself.
> I was a bit busy lately and am going through several mails now. Sorry.

No problem.  Not a huge problem.

> Am 26.04.2017 um 21:48 schrieb KARR, DAVID:
> > I'm connecting to a MariaDB database.  The app running in Tomcat that
> > uses the database is now setting "testWhileIdle" and "testOnReturn"
> > to true, because the connections seem to time out after a while of
> > being idle.  Those appear to mitigate the problem in the app itself.
> >
> > In SQuirreL, if I leave a connection open for a while, I get similar
> > errors like: ---------- Error: (conn:121) Could not read packet:
> > unexpected end of stream, read 0 bytes from 4 ---------
> >
> > It's not clear to me how to configure the connection automatically to
> > mitigate these problems.
> >
> > What's even worse is that when I try to "Reconnect", it just fails
> > with "Error: (conn:121) Connection is close".  I actually have to
> > completely close the connection and reopen it, and then it works until
> > I go idle again.
> >
> > What can I do to mitigate these problems in SQuirreL?
>
> Right click your Alias -> Alias properties -> Tab 'Connection'. The SQL
> entered there will be executed periodically with configurable repeat
> time.

Interesting.  That certainly works.

Any idea why MariaDB connections behave differently from Oracle connections?  Oracle connections do time out, but I just have to "Reconnect" to fix that.

If connections to particular databases don't "time out well", or have other specific behavior that have to be dealt with through alias properties, it seems like it would be useful for users to be able to set these properties in the Driver, essentially defining a properties template for aliases created for that driver.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Squirrel-sql-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Loading...