When viewing the query log, I see an odd pattern for which I have no explanation.
After almost every request, I have "select 1 from DUAL".
I have no idea where this is coming from, and I am clearly not making the request explicitly.
The magazine basically looks like this:
10 Query SELECT some normal query 10 Query select 1 from DUAL 10 Query SELECT some normal query 10 Query select 1 from DUAL 10 Query SELECT some normal query 10 Query select 1 from DUAL 10 Query SELECT some normal query 10 Query select 1 from DUAL 10 Query SELECT some normal query 10 Query select 1 from DUAL ...etc...
Has anyone encountered this problem before?
MySQL Version: 5.0.51
Driver: Java 6 application using JDBC. Mysql-socket-java-5.1.6-bin.jar
Connection Pool: commons-dbcp 1.2.2
ValidationQuery was set to "select 1 from DUAL" (obviously), and apparently the connection pool uses testOnBorrow and testOnReturn for true if the validation request is not zero.
Another question that arises for me is whether I really need have a validation request, or if I can get a performance boost by disabling it, or at least reducing the frequency with which it is used. Unfortunately, the developer who wrote our "database manager" is no longer with us, so I canβt ask him to justify it for me. Any input would be appreciated. I am going to dig up the API and Google for a while and report back if I find anything useful.
EDIT: Added More Information
EDIT2: added information that was requested in the correct answer for those who find this later
java mysql connection-pooling apache-commons-dbcp
biggusjimmus May 27 '09 at 20:42 2009-05-27 20:42
source share