Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection Pool configuration: Tomcat jndi, SSL and MySQLNonTransientConnectionException

 
Fran Cricket
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using the tomcat connection pool via JNDI resources.

To avoid that the connection is lost after a long inactivity (more of 8 hours, that is the default value of MySQL variable wait_timeout), I have put validationQuery and testOnBorrow in the context.xml.

My context.xml is:


It works, but if a I use a SSL connection, it doesn't work anymore.

I obtain:


I wouldn't to use autoreconnect=true, 'cause it is not recommended by MySQL team itself

What could be the issue? Why this difference between SSL and no-SSL?
 
Fran Cricket
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems to work by putting ssl=true in the query string of the connection to db:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic