Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 24807 invoked from network); 27 Jan 2006 17:18:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Jan 2006 17:18:45 -0000 Received: (qmail 86403 invoked by uid 500); 27 Jan 2006 17:18:43 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 86386 invoked by uid 500); 27 Jan 2006 17:18:43 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 86375 invoked by uid 99); 27 Jan 2006 17:18:43 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jan 2006 09:18:43 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of scottzhu@gmail.com designates 64.233.162.206 as permitted sender) Received: from [64.233.162.206] (HELO zproxy.gmail.com) (64.233.162.206) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jan 2006 09:18:42 -0800 Received: by zproxy.gmail.com with SMTP id l8so659123nzf for ; Fri, 27 Jan 2006 09:18:22 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=S+O0zpfxxbIY1qfiOJpbtFCy1ltQsmdZkbzqZObBrnocVtWzghs0jpWQkpAN9EdFaS43z6yoTPWlGA5pGVrouK5X0sFpZqO6vs5l+m17bri4ze1ubScZbd2TL8xpS8F4XOF8Pnc0c2KLIauvQ/8aEaF8UPqaE0t25DcvZxv1bjQ= Received: by 10.36.109.13 with SMTP id h13mr2541193nzc; Fri, 27 Jan 2006 09:18:22 -0800 (PST) Received: by 10.36.33.5 with HTTP; Fri, 27 Jan 2006 09:18:21 -0800 (PST) Message-ID: Date: Fri, 27 Jan 2006 12:18:21 -0500 From: Scott Zhu To: user-java@ibatis.apache.org Subject: reset jdbc connection MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2036_2044587.1138382301916" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_2036_2044587.1138382301916 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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: 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 =3D jdbc:weblogic:pool:Campaign Barcelona, props =3D {enableTwoPhaseCommit=3Dfa= lse, connectionPoolID=3DCampaign Barcelona, jdbcTxDataSource=3Dtrue, dataSourceName=3DCampaign 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.executeQueryFor= List (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 t= o 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. ------=_Part_2036_2044587.1138382301916 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
   I'm using weblogic 8.1 in this case and transaction is ma= naged by the application server. Here's my configuration for the sql map:
 
   <transactionManager commitRequired=3D"true" = type=3D"JDBC">
     <dataSource type= =3D"JNDI">
        <p= roperty name=3D"DataSource" value=3D"${dataSourceName}"= />
     </dataSource>
   </trans= actionManager>
 
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:<= /div>
 
java.sql.SQLException: Cannot obtain connection: driverURL =3D jdbc:we= blogic:pool:Campaign Barcelona, props =3D {enableTwoPhaseCommit=3Dfalse, co= nnectionPoolID=3DCampaign Barcelona, jdbcTxDataSource=3Dtrue, dataSourceNam= e=3DCampaign Data Source for partition1}.
Nested Exception: java.lang.RuntimeException: Failed to setAutoCommit t= o true for pool connection.
 at weblogic.jdbc.wrapper.PoolConnectio= n.init(PoolConnection.java:47)
 at weblogic.jdbc.pool.Driver.alloca= teConnection (Driver.java:254)
 at weblogic.jdbc.pool.Driver.connect(Driver.java= :164)
 at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:5= 09)
 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.j= dbc.JdbcTransaction.init(JdbcTransaction.java:48)
 at com.ibatis.sq= lmap.engine.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.= java:89)
 at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.ex= ecuteQueryForList(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 co= nnections periodically to avoid this. But this problem doesn't seem to happ= en 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.
------=_Part_2036_2044587.1138382301916--