> -----Original Message----- > From: Romain Manni-Bucau [mailto:[email protected]] > Sent: Thursday, August 18, 2016 12:04 PM > To: [email protected] > Subject: Re: Correct datasource settings to ensure connections are > always reestablished? > > Hello > > Check warnings in startup logs > > Suspect it is testWhileXxx instead of testOnXxx\
It was "testWhileIdle", not "testOnIdle", but the others are "testOn...". > Le 18 août 2016 20:17, "KARR, DAVID" <[email protected]> a écrit : > > > My app with a DataSource was basically working, but I found that > > sometimes it loses the db connection, and it apparently doesn't > restore it. > > > > I'm now testing with the following added properties: > > ------------- > > sus2.testOnReturn = true > > sus2.testOnIdle = true > > sus2.testOnBorrow = true > > sus2.validationQuery = select 1 from dual; > > ------------- > > > > The connection loss doesn't happen very often, so I'd have to leave it > > running for a while to make sure, but does this look like the correct > > set of settings to ensure db connections are always reestablished? > > > > When I started it back up, I did notice some occurrences of > > "java.sql.SQLException: Failed to validate a newly established > > connection.", but the app appears to be working, so perhaps this is > > just telling me that the settings are working. > > > > I guess I'll enable JMX and see what I can see about the status of the > > DataSource. > >
