Scott, I had the exact same problem with Hibernate (and in my case MySQL,
but I think it is more related to hibernate). It was fixed by using a
context.xml file placed in the META-INF directory (at the same level as your
WEB-INF directory). The following is my sanitized context.xml file.
<Context path="/SomeApp" docBase="/SomeApp" debug="0" reloadable="false">
<Resource
name="jdbc/cpsomeapp"
auth="Container"
type="javax.sql.DataSource"
factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
maxActive="100"
maxIdle="30"
minIdle="10"
maxWait="15000"
username="myuser"
password="mypassword"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/dbname"
removeAbandoned="true"
removeAbandonedTimeout="300"
validationQuery="select 1"
logAbandoned="true"
testOnBorrow="true"
testOnReturn="true"
testWhileIdle="true"
/>
</Context>
HTH,
Aaron Bartell
http://mowyourlawn.com
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Johnson
Sent: Thursday, December 13, 2007 7:06 PM
To: MIDRANGE-L@xxxxxxxxxxxx
Subject: JDBC Connection Time-out
We have an outside consultant using the JTOpen JDBC driver to connect to
our i5 (v5r4). They are using apache, tomcat, hibernate, and such. They
are saying that their connections are getting dropped after a time of
in-activity. They have asked me if there are any settings on the i5 that
control this. From what I have been able to find out via searching is that
there is nothing and that it has to do with how they have the connection
set-up on their side. I just need confirmation that this would be true and
I can then throw it back into their lap.
I checked the "TCP keep alive" setting on the i5 and it is set to 120
(default). I could change this down to a lower level, but I don't see how
that would solve their problem. The first person in the morning after an
long evening of inactivity on the website would still have problems.
Thanks,
Scott J.
As an Amazon Associate we earn from qualifying purchases.