Excellent information!  I will try those immediately.

mitch


Christopher Schultz wrote:
> Mitch,
>
> On 12/10/2009 7:43 PM, Mitch Claborn wrote:
> >               poolPreparedStatements="true"
> >               driverClassName="com.mysql.jdbc.Driver"
> >               validationQuery="select * from operator limit 1"
>
> FWIW, this is a non-ideal validation query:
>
> 1. It uses SELECT *, which is not particularly efficient.
> 2. It uses a real table, which means that real data will be selected.
> 3. It uses a LIMIT, which means that you know that too much data is
>    going to come back.
>
> Might I suggest:
>
> validationQuery="/* ping */SELECT 1"
>
> MySQL Connector/J drivers after a certain version recognize the "/* ping
> */" at the beginning of the query and will execute a low-level
> connection check that does not involve a query at all! So, you get your
> validation that the connection is properly connected without all that
> silly work on the server.
>
> If the version of the MySQL driver is NOT new enough, it will execute
> the "SELECT 1" query which consults no tables and executed super fast.
>
> You win both ways.
>
> >               testWhileIdle="true"
> >               testOnBorrow="false"
> >               testOnReturn="false"
>
> That's an odd configuration... why test while idle but not when the
> connection is needed?
>
> I suspect that if you set testOnBorrow="true" and testWhileIdle="false",
> you will avoid your deadlock problem.
>
> -chris

---------------------------------------------------------------------
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