ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From CppPlease <theni...@hotmail.co.uk>
Subject "No operations allowed after connection closed" occasionally when using queryForList
Date Thu, 31 May 2007 14:51:00 GMT

Hi there,

I'm using the code mentioned below (with try catches and such) and it seems
to work fine 90% of the time.  However, occassionlly I get a "No operations
allowed after connection closed" error.  A few more details are below.

--- Check the SQL Statement (preparation failed).  
--- Cause: java.sql.SQLException: No operations allowed after connection
StackTrace : com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in getAllAddresses.xml.  
--- The error occurred while executing query.  

This is the code (minus try/catch)

SqlMapClient sqlMap
Reader reader = Resources.getResourceAsReader("sqlMapConfig.xml");
sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);
List myList = sqlMap.queryForList("getAllAddresses", null);

Finally this is the sqlMapConfig.xml I'm using

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
      <settings cacheModelsEnabled="true" enhancementEnabled="true"
                   lazyLoadingEnabled="true" maxRequests="32"
                   maxTransactions="5" useStatementNamespaces="false" />
      <transactionManager type="JDBC">
            <dataSource type="SIMPLE">
                  <property name="JDBC.Driver" value="com.mysql.jdbc.Driver"
                  <property name="JDBC.ConnectionURL"
value="jdbc:mysql://mymachine:3306/mydatabase" />
                  <property name="JDBC.Username" value="myuser" />
                  <property name="JDBC.Password" value="mypassword" />
      <sqlMap resource="getAllAddresses.xml" />

I was hoping someone might be able to shed a little light on why this might
be happening sporadically?  The database is a v.simple mysql database with 1
table.  Also using mysql-connector-java-3.1.7-bin.jar.

Help is much appreciated,
Thanks in advance.
View this message in context: http://www.nabble.com/%22No-operations-allowed-after-connection-closed%22-occasionally-when-using-queryForList-tf3846980.html#a10895483
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

View raw message