Re: Communications link failure due to underlying exception
Posted by: Alper Akture
Date: July 20, 2005 12:03PM

I'm using tomcat 5.5.7, and it seems that the DataSource config properties have gone from elements (as you posted) to attributes. I could not find this specifically in the tomcat docs, but I was getting nulls for the driver and url when I had them as elements. So I have configured my server.xml with the following:

<Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
username="scott" password="tiger" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://pso-curly:3306/ysbuild"
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
maxActive="100"
maxIdle="30"
maxWait="5000"
validationQuery="SELECT 1"
testOnBorrow="true"
testWhileIdle="true"
timeBetweenEvictionRunsMillis="1000"
minEvictableIdleTimeMillis="60000"
/>

I seem to get the connection ok, but still, after being idle, I get the dreaded com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
...

I see my sql statements in the mysql log file, but I don't see any of the "SELECT 1" validationQuery statements. Should I see those in the logs somewhere? Or does this mean that they are not being executed, which could be causing the pool connections to be closed? The only statements in the mysql log during the ilde period are:

050720 10:57:37 26 Query SET autocommit=1
26 Query SET autocommit=1

Thanks for any help!!

Options: ReplyQuote


Subject
Written By
Posted
Re: Communications link failure due to underlying exception
July 20, 2005 12:03PM
June 09, 2006 04:42AM
August 24, 2006 05:27PM
July 15, 2007 04:27AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.