[ http://issues.apache.org/jira/browse/IBATIS-158?page=all ]
     
Clinton Begin closed IBATIS-158:
--------------------------------

    Resolution: Invalid


>> Connection has been invalidated (probably released back to the pool). 

This is not an RDBMS error, it's a  user error.  It generally means that your 
transaction management pattern is not correct.  For example, you should be sure 
to use the following pattern:

try {
  sqlMapClient.startTransaction();
  // ... do work
  sqlMapClient.commitTransaction();
} finally {
  sqlMapClient.endTransaction();
}

-- OR -- 

Don't use transactions at all, and simply call your statements.

Object obj = sqlMapClient.queryForObject("statementThatDoesntNeedTx", param);


If you don't use one of the above patterns, your connections can be forcefully 
collected in which case you'll receive the above error intermittently.

This issue will be closed, as it's an expected result.  We can reopen it if a 
problem is found.

Clinton

> After running for a couple of days handles are being returned to the pool???
> ----------------------------------------------------------------------------
>
>          Key: IBATIS-158
>          URL: http://issues.apache.org/jira/browse/IBATIS-158
>      Project: iBatis for Java
>         Type: Bug
>  Environment: Gentoo Linux
>     Reporter: Skoob

>
> If I do /etc/init.d/tomcat5 restart then everything starts working again for 
> an arbitrary amount of time.
> Here is the stack Trace.
> Exception:   
> --- The error occurred in 
> com/mycompany/persistence/sqlmapdao/sql/myStmts.xml.  
> --- The error occurred while executing query.  
> --- Check the SQL Statement (preparation failed).  
> --- Cause: com.ibatis.common.exception.NestedRuntimeException: Error 
> accessing SimplePooledConnection.  Connection has been invalidated (probably 
> released back to the pool).
> Stack trace:
>       Length: 56
>       at 
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:184)
>       at 
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:119)
>       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:105)
>       at 
> com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:77)
>       at 
> com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForList(SqlMapDaoTemplate.java:203)
>       at sun.reflect.GeneratedMethodAccessor1074.invoke(Unknown Source)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:324)
>       at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:64)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to