Re: [Squirrel-sql-users] MariaDB connections start failing after idle and won't reconnect
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
From: KARR, D. <dk...@at...> - 2017-04-29 23:58:51
|
> -----Original Message----- > From: Gerd Wagner [mailto:ger...@t-...] > Sent: Saturday, April 29, 2017 4:21 AM > To: KARR, DAVID <dk...@at...>; squirrel-sql- > us...@li... > 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. |