RE: Tomcat7 - ajax and connection pool : connection closed despite the use of validationQuery and testOnBorrow

2013-04-08 Thread Propes, Barry L
OK, thank you, Jose! Good to know if I ever go the MySQL route. -Original Message- From: Jose María Zaragoza [mailto:demablo...@gmail.com] Sent: Friday, April 05, 2013 5:07 PM To: Tomcat Users List Subject: Re: Tomcat7 - ajax and connection pool : connection closed despite the use of

Re: Tomcat7 - ajax and connection pool : connection closed despite the use of validationQuery and testOnBorrow

2013-04-05 Thread Michael-O
Am 2013-04-05 11:37, schrieb Jean-Claude Haw-King-Chon: Hi, I use the connection pool of tomcat7 and set a connection in a ThreadLocal. The context is a web application : the threadLocal is configured when the http request is initialized. The jdbc connection is closed and removed from the

Re: Tomcat7 - ajax and connection pool : connection closed despite the use of validationQuery and testOnBorrow

2013-04-05 Thread Jean-Claude Haw-King-Chon
I wish to avoid passing the connection through the layers of the application (from controller to DAO). The controller initialize the connection and must pass it to the Dao layer. I don't want to pass the datasource or connection to the business layer as a parameter. Futher, the data source

Re: Tomcat7 - ajax and connection pool : connection closed despite the use of validationQuery and testOnBorrow

2013-04-05 Thread Konstantin Kolinko
2013/4/5 Jean-Claude Haw-King-Chon jchaw-king-c...@medifirst.fr: Hi, I use the connection pool of tomcat7 and set a connection in a ThreadLocal. The context is a web application : the threadLocal is configured when the http request is initialized. The jdbc connection is closed and removed

Re: Tomcat7 - ajax and connection pool : connection closed despite the use of validationQuery and testOnBorrow

2013-04-05 Thread Michael-O
Fist of all, do NOT top post. Use the power of your wondeful mail client. Am 2013-04-05 13:05, schrieb Jean-Claude Haw-King-Chon: I wish to avoid passing the connection through the layers of the application (from controller to DAO). The controller initialize the connection and must pass it to

Re: Tomcat7 - ajax and connection pool : connection closed despite the use of validationQuery and testOnBorrow

2013-04-05 Thread Jean-Claude Haw-King-Chon
Le 05/04/2013 13:09, Konstantin Kolinko a écrit : 2013/4/5 Jean-Claude Haw-King-Chon jchaw-king-c...@medifirst.fr: Hi, I use the connection pool of tomcat7 and set a connection in a ThreadLocal. The context is a web application : the threadLocal is configured when the http request is

Re: Tomcat7 - ajax and connection pool : connection closed despite the use of validationQuery and testOnBorrow

2013-04-05 Thread Konstantin Kolinko
2013/4/5 Jean-Claude Haw-King-Chon jchaw-king-c...@medifirst.fr: Le 05/04/2013 13:09, Konstantin Kolinko a écrit : 2013/4/5 Jean-Claude Haw-King-Chon jchaw-king-c...@medifirst.fr: Hi, I use the connection pool of tomcat7 and set a connection in a ThreadLocal. The context is a web

Re: Tomcat7 - ajax and connection pool : connection closed despite the use of validationQuery and testOnBorrow

2013-04-05 Thread Jose María Zaragoza
Hi Konstantin: About this link http://commons.apache.org/proper/commons-dbcp/configuration.html If you have enabled removeAbandoned then it is possible that a connection is reclaimed by the pool because it is considered to be abandoned. This mechanism is triggered when (getNumIdle() 2) and

RE: Tomcat7 - ajax and connection pool : connection closed despite the use of validationQuery and testOnBorrow

2013-04-05 Thread Propes, Barry L
I could be wrong, but is that validationQuery attribute correct? SELECT 1 ? - I have validationQuery=select 1 from dual in mine, and my doc states it has to be a valid SQL statement returning at least one row. That may not factor in at all, just noticed it. Looked maybe out of kilter.

Re: Tomcat7 - ajax and connection pool : connection closed despite the use of validationQuery and testOnBorrow

2013-04-05 Thread Jose María Zaragoza
'select 1 from dual' works in Oracle DB In MySQL, select 1 2013/4/5 Propes, Barry L barry.l.pro...@citi.com I could be wrong, but is that validationQuery attribute correct? SELECT 1 ? - I have validationQuery=select 1 from dual in mine, and my doc states it has to be a valid SQL

RE: Tomcat7 - ajax and connection pool : connection closed despite the use of validationQuery and testOnBorrow

2013-04-05 Thread Propes, Barry L
Ok, thanks for clarification. I thought it had to be from some faux table or object. -Original Message- From: Jose María Zaragoza [mailto:demablo...@gmail.com] Sent: Friday, April 05, 2013 3:44 PM To: Tomcat Users List Subject: Re: Tomcat7 - ajax and connection pool : connection

Re: Tomcat7 - ajax and connection pool : connection closed despite the use of validationQuery and testOnBorrow

2013-04-05 Thread Jose María Zaragoza
And that's right . You can define any SQL , but you prefer the easiest ( and fastest ) Indeed , you could use SELECT 1 FROM DUAL in MySQL, but it's not required by using FROM DUAL From MySQL doc DUAL is purely for the convenience of people who require that all SELECT statements should have FROM