ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@teamics.com
Subject Re: Error accessing SimplePooledConnection. Connection has been invalidated
Date Tue, 18 Jan 2005 17:12:53 GMT
<div>The getConnection() method was from
com.ibatis.dao.client.template.JdbcDaoTemplate.&nbsp; I decided NOT to
extend JdbcDaoTemplate and write my own getConnection() method to get
around the problem.&nbsp; Life is good now.<br><div><br><div><br></div><font
color="#990099">-----Clinton Begin &lt;clinton.begin@gmail.com&gt; wrote: -----<br><br></font><blockquote
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left:
5px; margin-right: 0px;">To: ibatis-user-java@incubator.apache.org<br>From: Clinton
Begin &lt;clinton.begin@gmail.com&gt;<br>Date: 01/18/2005 10:12AM<br>Subject:
Re: Error accessing SimplePooledConnection. Connection has been invalidated<br><br><font
face="monospace" size="3">What is in getConnection() ???<br><br>Clinton<br><br><br>On
Tue, 18 Jan 2005 09:28:56 -0600, stevem@teamics.com<br><stevem @teamics.com="">
wrote:<br>&gt; Can you mix DAO implementations? &nbsp;I am in a restrictive
Oracle environment<br>&gt; that prevents me from deploying the Default CLOB support
using the Oracle 10<br>&gt; JDBC drivers (which works great, by the way). &nbsp;The
client's servers still<br>&gt; have Oracle 8i drivers (go figure). &nbsp;I re-wrote
the affected DAO as a JDBC<br>&gt; DAO, but the code (below) results in the attached
error. &nbsp;I'm not finding<br>&gt; much help on the web. &nbsp;I tried
changing to a JDBC transaction manager, but<br>&gt; that broke my SqlMap DAOs.<br>&gt;
&nbsp;<br>&gt; &nbsp; &nbsp; &nbsp;private void insert(ProductRequirement
pr) {<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Connection conn
= null;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PreparedStatement
stmt = null;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try {<br>&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;daoManager.startTransaction();<br>&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;conn = getConnection();
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>&gt; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;StringBuffer sql = new StringBuffer("INSERT
INTO ");<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;sql.append(" PRL_PRODUCT_REQ (PRODUCT_REQ_ID, DESCRIPTION,<br>&gt; FILING_TYPES,
PRODUCT_ID, ");<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;sql.append(" PRODUCT_REQ_CAT_ID, PRL_STATE_ID,<br>&gt; DATE_LAST_MODIFIED,
USER_LAST_MODIFIED, ");<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;sql.append(" DATE_CREATED, USER_CREATED) ");<br>&gt; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sql.append(" VALUES (?, EMPTY_CLOB(),
?, ?, ?, ?, ?, ?, ?,<br>&gt; ?)");<br>&gt; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; stmt = conn.prepareStatement(sql.toString());
&nbsp;&lt;-- Fails here<br>&gt; &nbsp;<br>&gt; &nbsp;com.ibatis.common.exception.NestedRuntimeException:
Error accessing<br>&gt; SimplePooledConnection. &nbsp;Connection has been invalidated
(probably released<br>&gt; back to the pool).<br>&gt; &nbsp; &nbsp;
&nbsp;at<br>&gt; com.ibatis.common.jdbc.SimpleDataSource$SimplePooledConnection.getValidConnection(SimpleDataSource.java:901)<br>&gt;
&nbsp; &nbsp; &nbsp;at<br>&gt; com.ibatis.common.jdbc.SimpleDataSource$SimplePooledConnection.invoke(SimpleDataSource.java:946)<br>&gt;
&nbsp; &nbsp; &nbsp;at $Proxy8.prepareStatement(Unknown Source)<br>&gt;
&nbsp; &nbsp; &nbsp;at<br>&gt; com.serff.prl.dao.impl.OracleJdbcProductRequirementDAO.insert(OracleJdbcProductRequirementDAO.java:224)<br>&gt;
&nbsp; &nbsp; &nbsp;at<br>&gt; com.serff.prl.dao.impl.OracleJdbcProductRequirementDAO.saveOrUpdate(OracleJdbcProductRequirementDAO.java:154)<br>&gt;
&nbsp; &nbsp; &nbsp;at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>&gt;
&nbsp; &nbsp; &nbsp;at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)<br>&gt;
&nbsp; &nbsp; &nbsp;at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)<br>&gt; &nbsp; &nbsp; &nbsp;at java.lang.reflect.Method.invoke(Unknown
Source)<br>&gt; &nbsp; &nbsp; &nbsp;at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:72)<br>&gt;
&nbsp; &nbsp; &nbsp;at $Proxy6.saveOrUpdate(Unknown Source)<br>&gt;
&nbsp; &nbsp; &nbsp;at<br>&gt; com.serff.prl.dao.ProductRequirementTest.testProductRequirementCRUD(ProductRequirementTest.java:176)<br>&gt;
&nbsp; &nbsp; &nbsp;at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>&gt;
&nbsp; &nbsp; &nbsp;at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)<br>&gt;
&nbsp; &nbsp; &nbsp;at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)<br>&gt; &nbsp; &nbsp; &nbsp;at java.lang.reflect.Method.invoke(Unknown
Source)<br>&gt; &nbsp; &nbsp; &nbsp;at junit.framework.TestCase.runTest(TestCase.java:154)<br>&gt;
&nbsp; &nbsp; &nbsp;at junit.framework.TestCase.runBare(TestCase.java:127)<br>&gt;
&nbsp; &nbsp; &nbsp;at junit.framework.TestResult$1.protect(TestResult.java:106)<br>&gt;
&nbsp; &nbsp; &nbsp;at junit.framework.TestResult.runProtected(TestResult.java:124)<br>&gt;
&nbsp; &nbsp; &nbsp;at junit.framework.TestResult.run(TestResult.java:109)<br>&gt;
&nbsp; &nbsp; &nbsp;at junit.framework.TestCase.run(TestCase.java:118)<br>&gt;
&nbsp; &nbsp; &nbsp;at junit.framework.TestSuite.runTest(TestSuite.java:208)<br>&gt;
&nbsp; &nbsp; &nbsp;at junit.framework.TestSuite.run(TestSuite.java:203)<br>&gt;
&nbsp; &nbsp; &nbsp;at<br>&gt; org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)<br>&gt;
&nbsp; &nbsp; &nbsp;at<br>&gt; org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)<br>&gt;
&nbsp; &nbsp; &nbsp;at<br>&gt; org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)<br>&gt;
<br>&gt;<br></stevem></font></blockquote><br></div></div>
Mime
View raw message