Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 45191 invoked from network); 31 May 2007 16:38:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 May 2007 16:38:06 -0000 Received: (qmail 19048 invoked by uid 500); 31 May 2007 16:38:07 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 19036 invoked by uid 500); 31 May 2007 16:38:07 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 19023 invoked by uid 99); 31 May 2007 16:38:07 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 May 2007 09:38:07 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [196.35.77.149] (HELO mfwjhe02.mfw.is.co.za) (196.35.77.149) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 May 2007 09:38:00 -0700 Received: from as-smtp05.he.businessgateway.co.za (Not Verified[196.26.57.71]) by mfwjhe02.mfw.is.co.za with MailMarshal (v6,1,8,2172) id ; Thu, 31 May 2007 18:33:58 +0200 Received: from pascptwsmeind ([41.245.166.161]) by as-smtp05.he.businessgateway.co.za with Microsoft SMTPSVC(6.0.3790.1830); Thu, 31 May 2007 18:37:35 +0200 From: "Meindert" To: Subject: RE: "No operations allowed after connection closed" occasionally when using queryForList Date: Thu, 31 May 2007 18:37:35 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0009_01C7A3B2.C1FE8EA0" X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 In-Reply-To: Thread-Index: Acejkzb1w/7cDgSQT8WaygbUnNhLdQAAUFfQAANO7mA= Message-ID: X-OriginalArrivalTime: 31 May 2007 16:37:35.0927 (UTC) FILETIME=[FE902470:01C7A3A1] X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. ------=_NextPart_000_0009_01C7A3B2.C1FE8EA0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I had that problem with 'stale' connections, and added the ping To sqlMapConfig -----Original Message----- From: James, Steven [mailto:steven.james@logicacmg.com] Sent: 31 May 2007 05:03 PM To: user-java@ibatis.apache.org Subject: RE: "No operations allowed after connection closed" occasionally when using queryForList I have had this error with mysql, check to see that you are not creating more than one Sqlclient. Secondly you have lazy loading on so ensure you are not calling a get on mapped object outside of the transaction. -----Original Message----- From: CppPlease [mailto:theniguy@hotmail.co.uk] Sent: Donnerstag, 31. Mai 2007 16:51 To: user-java@ibatis.apache.org Subject: "No operations allowed after connection closed" occasionally when using queryForList 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 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%2 2-occasionally-when-using-queryForList-tf3846980.html#a10895483 Sent from the iBATIS - User - Java mailing list archive at Nabble.com. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. ------=_NextPart_000_0009_01C7A3B2.C1FE8EA0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I had that problem with 'stale' connections, and = added the ping

      <property name=3D"Pool.PingQuery" value=3D"SELECT = 1"/>

      <property name=3D"Pool.PingEnabled" value=3D"true" = />

      <property name=3D"Pool.PingConnectionsOlderThan" = value=3D"1000000" />

To sqlMapConfig

 

-----Original Message-----
From: James, Steven [mailto:steven.james@logicacmg.com]
Sent: 31 May 2007 05:03 PM
To: user-java@ibatis.apache.org
Subject: RE: "No operations allowed after connection closed" occasionally when using queryForList

 

I have had this error with mysql, check to see that you are not creating

more than one Sqlclient. Secondly you have lazy loading on so = ensure you

are not calling a get on mapped object outside of the = transaction.

 

-----Original Message-----

From: CppPlease [mailto:theniguy@hotmail.co.uk] =

Sent: Donnerstag, 31. Mai 2007 = 16:51

To: user-java@ibatis.apache.org

Subject: "No operations allowed after connection = closed" occasionally

when using queryForList

 

 

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 =3D Resources.getResourceAsReader("sqlMapConfig.xml");

sqlMap =3D = SqlMapClientBuilder.buildSqlMapClient(reader);

List myList =3D sqlMap.queryForList("getAllAddresses", = null);

 

Finally this is the sqlMapConfig.xml I'm = using

 

<?xml version=3D"1.0" encoding=3D"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=3D"true" = enhancementEnabled=3D"true"

           = ;        lazyLoadingEnabled=3D"true" = maxRequests=3D"32"

maxSessions=3D"10"

           = ;        maxTransactions=3D"5" = useStatementNamespaces=3D"false" = />

      <transactionManager = type=3D"JDBC">

           = ; <dataSource = type=3D"SIMPLE">

           = ;       <property name=3D"JDBC.Driver"

value=3D"com.mysql.jdbc.Driver"

/>

           = ;       <property = name=3D"JDBC.ConnectionURL"

           = ;            =        

value=3D"jdbc:mysql://mymachine:3306/mydatabase" = />

           = ;       <property name=3D"JDBC.Username" value=3D"myuser" = />

           = ;       <property name=3D"JDBC.Password" = value=3D"mypassword" />

           = ; </dataSource>

      = </transactionManager>

      <sqlMap resource=3D"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-c= losed%2

2-occasionally-when-using-queryForList-tf3846980.html#a10895483

Sent from the iBATIS - User - Java mailing list archive at = Nabble.com.

 

 

 

This e-mail and any attachment is for authorised use by the = intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be = copied, disclosed to, retained or used by, any other party. If you are not an = intended recipient then please promptly delete this e-mail and any attachment and = all copies and inform the sender. Thank you.

------=_NextPart_000_0009_01C7A3B2.C1FE8EA0--