Oh, well, that was your problem.  You should NEVER be calling
daoManager.startTransaction from WITHIN a DAO.

That's a very bad thing... :-(

Clinton


On Tue, 18 Jan 2005 11:12:53 -0600, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> The getConnection() method was from
> com.ibatis.dao.client.template.JdbcDaoTemplate.  I decided NOT to extend
> JdbcDaoTemplate and write my own getConnection() method to get around the
> problem.  Life is good now.
> 
> 
> -----Clinton Begin <[EMAIL PROTECTED]> wrote: -----
> 
> To: ibatis-user-java@incubator.apache.org
> From: Clinton Begin <[EMAIL PROTECTED]>
> Date: 01/18/2005 10:12AM
> Subject: Re: Error accessing SimplePooledConnection. Connection has been
> invalidated
> 
> 
> What is in getConnection() ???
> 
> Clinton
> 
> 
> On Tue, 18 Jan 2005 09:28:56 -0600, [EMAIL PROTECTED]
>  wrote:
> > Can you mix DAO implementations?  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).  The client's servers still
> > have Oracle 8i drivers (go figure).  I re-wrote the affected DAO as a JDBC
> > DAO, but the code (below) results in the attached error.  I'm not finding
> > much help on the web.  I tried changing to a JDBC transaction manager, but
> > that broke my SqlMap DAOs.
> >  
> >      private void insert(ProductRequirement pr) {
> >          Connection conn = null;
> >          PreparedStatement stmt = null;
> >          try {
> >              daoManager.startTransaction();
> >              conn = getConnection();           
> >              StringBuffer sql = new StringBuffer("INSERT INTO ");
> >              sql.append(" PRL_PRODUCT_REQ (PRODUCT_REQ_ID, DESCRIPTION,
> > FILING_TYPES, PRODUCT_ID, ");
> >              sql.append(" PRODUCT_REQ_CAT_ID, PRL_STATE_ID,
> > DATE_LAST_MODIFIED, USER_LAST_MODIFIED, ");
> >              sql.append(" DATE_CREATED, USER_CREATED) ");
> >              sql.append(" VALUES (?, EMPTY_CLOB(), ?, ?, ?, ?, ?, ?, ?,
> > ?)");
> >               stmt = conn.prepareStatement(sql.toString());  <-- Fails
> here
> >  
> >  com.ibatis.common.exception.NestedRuntimeException: Error accessing
> > SimplePooledConnection.  Connection has been invalidated (probably
> released
> > back to the pool).
> >      at
> >
> com.ibatis.common.jdbc.SimpleDataSource$SimplePooledConnection.getValidConnection(SimpleDataSource.java:901)
> >      at
> >
> com.ibatis.common.jdbc.SimpleDataSource$SimplePooledConnection.invoke(SimpleDataSource.java:946)
> >      at $Proxy8.prepareStatement(Unknown Source)
> >      at
> >
> com.serff.prl.dao.impl.OracleJdbcProductRequirementDAO.insert(OracleJdbcProductRequirementDAO.java:224)
> >      at
> >
> com.serff.prl.dao.impl.OracleJdbcProductRequirementDAO.saveOrUpdate(OracleJdbcProductRequirementDAO.java:154)
> >      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> >      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >      at java.lang.reflect.Method.invoke(Unknown Source)
> >      at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:72)
> >      at $Proxy6.saveOrUpdate(Unknown Source)
> >      at
> >
> com.serff.prl.dao.ProductRequirementTest.testProductRequirementCRUD(ProductRequirementTest.java:176)
> >      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> >      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >      at java.lang.reflect.Method.invoke(Unknown Source)
> >      at junit.framework.TestCase.runTest(TestCase.java:154)
> >      at junit.framework.TestCase.runBare(TestCase.java:127)
> >      at junit.framework.TestResult$1.protect(TestResult.java:106)
> >      at junit.framework.TestResult.runProtected(TestResult.java:124)
> >      at junit.framework.TestResult.run(TestResult.java:109)
> >      at junit.framework.TestCase.run(TestCase.java:118)
> >      at junit.framework.TestSuite.runTest(TestSuite.java:208)
> >      at junit.framework.TestSuite.run(TestSuite.java:203)
> >      at
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
> >      at
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
> >      at
> >
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
> > 
> >
> 
>

Reply via email to