You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Thomas Karl Schwaerzler <Th...@uibk.ac.at> on 2007/01/09 15:29:27 UTC

database connection timeout?



i have ibatis/abator included in my web application using struts.

everything is running great until now, but when i came to my testserver 
this morning i got the follwoing error
when doing any request that needs access to database:

...
Caused by: java.sql.SQLException: No more data to read from socket
         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)
         at 
oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1118)
         at 
oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1070)
         at 
oracle.jdbc.driver.T4C7Ocommoncall.receive(T4C7Ocommoncall.java:106)
         at 
oracle.jdbc.driver.T4CConnection.doRollback(T4CConnection.java:567)
...



..as far as know this error is caused by a connection timout at the 
database connection.

i thought, that configuring a 'PingQuery' would prevent this by continuing 
sending kinda pings on the connection
in case nothing else happens to keep it up.
therefore i configured abator as follows:

         <jdbcConnection
                         driverClass="oracle.jdbc.driver.OracleDriver"
                         connectionURL="jdbc:oracle:thin:xxxxxxxxxxxxxxxxx"
                         userId="xxxxxxxx"
                         password="xxxxxx"
                 >
                 <classPathEntry location="xxxxxxxxx/ojdbc14.jar" />
                    <property name="Pool.TimeToWait" value="500"/>
            <property name="Pool.PingQuery" value="SELECT 1 FROM DUAL"/>
            <property name="Pool.PingEnabled" value="true"/>
            <!--  time in millisecs 3600000 = 1h -->
            <property name="Pool.PingConnectionsOlderThan" 
value="3600000"/>
            <property name="Pool.PingConnectionsNotUsedFor" 
value="3600000"/>
         </jdbcConnection>




i expected this configuration of abator to do pings every hour, which 
should be enough to keep the connection to
database alive.

why does abator/ibatis not behave as i expect?
is there a possibility to check if the ping really happens?

thanks in advance
tom.