ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Zhu <scott...@gmail.com>
Subject reset jdbc connection
Date Fri, 27 Jan 2006 17:18:21 GMT
   I'm using weblogic 8.1 in this case and transaction is managed by the
application server. Here's my configuration for the sql map:

   <transactionManager commitRequired="true" type="JDBC">
     <dataSource type="JNDI">
        <property name="DataSource" value="${dataSourceName}"/>
     </dataSource>
   </transactionManager>

If I shutdown the database and bring it back, then click on some links that
requires database access, I'd get the following exception sometimes:

java.sql.SQLException: Cannot obtain connection: driverURL =
jdbc:weblogic:pool:Campaign Barcelona, props = {enableTwoPhaseCommit=false,
connectionPoolID=Campaign Barcelona, jdbcTxDataSource=true,
dataSourceName=Campaign Data Source for partition1}.
Nested Exception: java.lang.RuntimeException: Failed to setAutoCommit to
true for pool connection.
 at weblogic.jdbc.wrapper.PoolConnection.init(PoolConnection.java:47)
 at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:254)
 at weblogic.jdbc.pool.Driver.connect(Driver.java:164)
 at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:509)
 at weblogic.jdbc.jts.Driver.connect(Driver.java:139)
 at weblogic.jdbc.common.internal.RmiDataSource.getConnection(
RmiDataSource.java:305)
 at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(
JdbcTransaction.java:48)
 at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(
JdbcTransaction.java:89)
 at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList
(GeneralStatement.java:123)
 at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(
SqlMapExecutorDelegate.java:610)
 at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(
SqlMapExecutorDelegate.java:584)
 at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(
SqlMapSessionImpl.java:101)
 at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(
SqlMapClientImpl.java:78)
...

It seemed like it's trying to use an old connection which is not valid any
more. I think I can try to enable "Test Reserved Connections" in weblogic to
test the connections periodically to avoid this. But this problem doesn't
seem to happen on raw jdbc access calls (not thru ibatis). So I wonder if
there's some setting in ibatis I need to do to fix this. Thanks for any
help.

Mime
View raw message