Return-Path: Delivered-To: apmail-ibatis-dev-archive@www.apache.org Received: (qmail 15002 invoked from network); 22 Mar 2008 02:55:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Mar 2008 02:55:24 -0000 Received: (qmail 55449 invoked by uid 500); 22 Mar 2008 02:55:22 -0000 Delivered-To: apmail-ibatis-dev-archive@ibatis.apache.org Received: (qmail 55290 invoked by uid 500); 22 Mar 2008 02:55:22 -0000 Mailing-List: contact dev-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ibatis.apache.org Delivered-To: mailing list dev@ibatis.apache.org Received: (qmail 55279 invoked by uid 99); 22 Mar 2008 02:55:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Mar 2008 19:55:22 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Mar 2008 02:54:40 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 585E5234C0AD for ; Fri, 21 Mar 2008 19:53:24 -0700 (PDT) Message-ID: <1763562080.1206154404361.JavaMail.jira@brutus> Date: Fri, 21 Mar 2008 19:53:24 -0700 (PDT) From: "Clinton Begin (JIRA)" To: dev@ibatis.apache.org Subject: [jira] Closed: (IBATIS-485) connection pool returns :"closed" connection? In-Reply-To: <24232344.1202843467894.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/IBATIS-485?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Clinton Begin closed IBATIS-485. -------------------------------- Resolution: Won't Fix Use a PingQuery to ensure connections are valid, or configure your server to have unlimited connection timeouts. > connection pool returns :"closed" connection? > --------------------------------------------- > > Key: IBATIS-485 > URL: https://issues.apache.org/jira/browse/IBATIS-485 > Project: iBatis for Java > Issue Type: Bug > Affects Versions: 2.3.0 > Environment: Java 1.5, Java 1.6, Ubuntu linux, mysql 5.0 > Reporter: vasu nori > > is ibatis giving me a "closed" connection (i.e., connecton handle which used to have connection open to database, but no longer) in the following scenario > 1. mapping xml file looks like this > > > > > > > > > > > > > 2. Java code > SqlMapClient sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader); > > .... > .... > sqlMap.queryForObject(queryid_in_mapping_file, params); > 3. if the server is left running overnight, the next morning here is the exception in the log file when the above statement is executed. seems like sqlMap gets a stale connection from the pool. > 79621040 [btpool0-1] DEBUG com.ibatis.common.jdbc.SimpleDataSource - Checked out connection 19658898 from pool. > 79621079 [btpool0-1] DEBUG java.sql.Connection - {conn-100030} Connection > 79621079 [btpool0-1] DEBUG java.sql.Connection - {conn-100030} Preparing Statement: SELECT * from emp where id = ?; > 79621084 [btpool0-1] ERROR java.sql.Connection - Error calling Connection.prepareStatement: > com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: No operations allowed after connection closed.Connection was implicitly closed due to underlying exception/error: > ** BEGIN NESTED EXCEPTION ** > com.mysql.jdbc.CommunicationsException > MESSAGE: Communications link failure > Last packet sent to the server was 38 ms ago. > STACKTRACE: > com.mysql.jdbc.CommunicationsException: Communications link failure > Last packet sent to the server was 38 ms ago. > at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1070) > at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3134) > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1818) > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1961) > at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2537) > at com.mysql.jdbc.ConnectionImpl.rollbackNoChecks(ConnectionImpl.java:4668) > at com.mysql.jdbc.ConnectionImpl.rollback(ConnectionImpl.java:4553) > at com.ibatis.common.jdbc.SimpleDataSource.popConnection(SimpleDataSource.java:629) > at com.ibatis.common.jdbc.SimpleDataSource.getConnection(SimpleDataSource.java:222) > at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTransaction.java:48) > at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:89) > at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123) > at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:615) > at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:589) > at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118) > at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:122) > at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:99) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.