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
closed.
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"
"http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
<settings cacheModelsEnabled="true" enhancementEnabled="true"
lazyLoadingEnabled="true" maxRequests="32"
maxSessions="10"
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" />
</dataSource>
</transactionManager>
<sqlMap resource="getAllAddresses.xml" />
</sqlMapConfig>
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.