ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@teamics.com
Subject Error accessing SimplePooledConnection. Connection has been invalidated
Date Tue, 18 Jan 2005 15:28:56 GMT
<div>Can you mix DAO implementations?&nbsp; I am in a restrictive
Oracle environment that prevents me from deploying the Default CLOB
support using the Oracle 10 JDBC drivers (which works great, by the
way).&nbsp; The client's servers still have Oracle 8i drivers (go
figure).&nbsp; I re-wrote the affected DAO as a JDBC DAO, but the code
(below) results in the attached error.&nbsp; I'm not finding much help
on the web.&nbsp; I tried changing to a JDBC transaction manager, but
that broke my SqlMap DAOs.<br>
<br>
&nbsp;&nbsp;&nbsp; private void insert(ProductRequirement pr) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Connection conn = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PreparedStatement stmt
= null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
daoManager.startTransaction();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
conn
=
getConnection();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
StringBuffer sql = new StringBuffer("INSERT INTO ");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
sql.append(" PRL_PRODUCT_REQ (PRODUCT_REQ_ID, DESCRIPTION,
FILING_TYPES, PRODUCT_ID, ");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
sql.append(" PRODUCT_REQ_CAT_ID, PRL_STATE_ID, DATE_LAST_MODIFIED,
USER_LAST_MODIFIED, ");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
sql.append(" DATE_CREATED, USER_CREATED) ");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
sql.append(" VALUES (?, EMPTY_CLOB(), ?, ?, ?, ?, ?, ?, ?, ?)");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
stmt = conn.prepareStatement(sql.toString());&nbsp; &lt;-- Fails here<br>
<br>
com.ibatis.common.exception.NestedRuntimeException: Error accessing
SimplePooledConnection.&nbsp; Connection has been invalidated (probably
released back to the pool).<br>
&nbsp;&nbsp;&nbsp; at
com.ibatis.common.jdbc.SimpleDataSource$SimplePooledConnection.getValidConnection(SimpleDataSource.java:901)<br>
&nbsp;&nbsp;&nbsp; at com.ibatis.common.jdbc.SimpleDataSource$SimplePooledConnection.invoke(SimpleDataSource.java:946)<br>
&nbsp;&nbsp;&nbsp; at $Proxy8.prepareStatement(Unknown Source)<br>
&nbsp;&nbsp;&nbsp; at com.serff.prl.dao.impl.OracleJdbcProductRequirementDAO.insert(OracleJdbcProductRequirementDAO.java:224)<br>
&nbsp;&nbsp;&nbsp; at
com.serff.prl.dao.impl.OracleJdbcProductRequirementDAO.saveOrUpdate(OracleJdbcProductRequirementDAO.java:154)<br>
&nbsp;&nbsp;&nbsp; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
&nbsp;&nbsp;&nbsp; at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)<br>
&nbsp;&nbsp;&nbsp; at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)<br>
&nbsp;&nbsp;&nbsp; at java.lang.reflect.Method.invoke(Unknown Source)<br>
&nbsp;&nbsp;&nbsp; at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:72)<br>
&nbsp;&nbsp;&nbsp; at $Proxy6.saveOrUpdate(Unknown Source)<br>
&nbsp;&nbsp;&nbsp; at com.serff.prl.dao.ProductRequirementTest.testProductRequirementCRUD(ProductRequirementTest.java:176)<br>
&nbsp;&nbsp;&nbsp; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
&nbsp;&nbsp;&nbsp; at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)<br>
&nbsp;&nbsp;&nbsp; at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)<br>
&nbsp;&nbsp;&nbsp; at java.lang.reflect.Method.invoke(Unknown Source)<br>
&nbsp;&nbsp;&nbsp; at junit.framework.TestCase.runTest(TestCase.java:154)<br>
&nbsp;&nbsp;&nbsp; at junit.framework.TestCase.runBare(TestCase.java:127)<br>
&nbsp;&nbsp;&nbsp; at junit.framework.TestResult$1.protect(TestResult.java:106)<br>
&nbsp;&nbsp;&nbsp; at junit.framework.TestResult.runProtected(TestResult.java:124)<br>
&nbsp;&nbsp;&nbsp; at junit.framework.TestResult.run(TestResult.java:109)<br>
&nbsp;&nbsp;&nbsp; at junit.framework.TestCase.run(TestCase.java:118)<br>
&nbsp;&nbsp;&nbsp; at junit.framework.TestSuite.runTest(TestSuite.java:208)<br>
&nbsp;&nbsp;&nbsp; at junit.framework.TestSuite.run(TestSuite.java:203)<br>
&nbsp;&nbsp;&nbsp; at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)<br>
&nbsp;&nbsp;&nbsp; at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)<br>
&nbsp;&nbsp;&nbsp; at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)<br><div><br></div></div>
Mime
View raw message