On 30/09/2009 13:38, MartinOShea wrote:

So select now() is fine.

(Where "fine" is defined as "not what you were advised to use, for sound reasons that are require a longer explanation than was necessary at the time".)

p


Thanks.


markt-2 wrote:

MartinOShea wrote:
Thanks for the reply.

Setting testOnBorrow to true is something I'll try but according to:

http://commons.apache.org/dbcp/configuration.html

If testOnBorrow is set to true, the validation query must be set to a
'non-null string'. Presumably this means that the query must always
return a
value such as validationQuery = "select now()" always returning the date
/
time?

It just means that testOnBorrow does nothing if validationQuery is set to
"".
For mysql "select 1" is sufficient and saves a call to now(). The Oracle
equivalent would be "select 1 from dual"

I just checked the dbcp source code and the criteria for the validation
query is
that it must return at least 1 row with no exceptions being thrown.

Mark



validationQuery = "select now()"

markt-2 wrote:
MartinOShea wrote:
But I think what is
happening after eight hours of inactivity, is that the system is trying
to
reuse a connection pool object that MySQL has closed down after its
default
eight hour period.
Sounds likely.

     testOnBorrow = "false"
Try setting this to true.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to