I'm troubleshooting this jsp application which runs in tomcat with Hibernate for the data access layer.
Here's my data source config.
Code:
<Context path="/">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_PandF_log." suffix=".txt" timestamp="true" />
<Resource name="jdbc/PandFDatabase"
auth="Container" type="javax.sql.DataSource" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
driverClassName="oracle.jdbc.OracleDriver"
username="username"
url="jdbc:oracle:thin:@hostname:1521:borpwap"
password="passwd"
removeAbandoned="true"
maxActive="30"
maxIdle="10"
maxWait="1000"
removeAbandonedTimeout="60"
logAbandoned="true"
testOnBorrow="true"
testOnReturn="true"
validationQuery="select 1 from dual"/> </Context>
After the app has been running for a while I keep getting a Closed connection exception in the tomcat logs. Its a hit and miss issue. When I reload the jsp page it works fine sometimes. Does anyone know what environment config changes could fix this issue?
I suspect the app could be using stale connections and I see gnarly code without any try catch finally while handling DB sessions. At this point, I dont think I can change code cos that may mean a re-write of this app. I'm looking for a config change in the environment that could possibley alleviate this issue.
Code:
7358762 [TP-Processor8] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 17008, SQLState: null
7358762 [TP-Processor8] ERROR org.hibernate.util.JDBCExceptionReporter - Closed Connection
7358774 [TP-Processor8] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/prod/projects].[jsp] - Servlet.service() for servlet jsp threw exception
java.sql.SQLException: Closed Connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)