Return-Path: Delivered-To: apmail-ibatis-dev-archive@www.apache.org Received: (qmail 60431 invoked from network); 10 Aug 2009 19:08:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Aug 2009 19:08:30 -0000 Received: (qmail 46640 invoked by uid 500); 10 Aug 2009 19:08:37 -0000 Delivered-To: apmail-ibatis-dev-archive@ibatis.apache.org Received: (qmail 46620 invoked by uid 500); 10 Aug 2009 19:08:37 -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 46612 invoked by uid 99); 10 Aug 2009 19:08:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Aug 2009 19:08:37 +0000 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; Mon, 10 Aug 2009 19:08:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D3DE3234C1EB for ; Mon, 10 Aug 2009 12:08:14 -0700 (PDT) Message-ID: <406950976.1249931294866.JavaMail.jira@brutus> Date: Mon, 10 Aug 2009 12:08:14 -0700 (PDT) From: "Kai Grabfelder (JIRA)" To: dev@ibatis.apache.org Subject: [jira] Commented: (IBATIS-615) Preparestatement cache bug In-Reply-To: <1320047759.1248291074986.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/IBATIS-615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12741498#action_12741498 ] Kai Grabfelder commented on IBATIS-615: --------------------------------------- have you by any chance by affected by IBATIS-436 and had no settings defined until configuring the transaction? > Preparestatement cache bug > -------------------------- > > Key: IBATIS-615 > URL: https://issues.apache.org/jira/browse/IBATIS-615 > Project: iBatis for Java > Issue Type: Bug > Affects Versions: 2.3.4 > Environment: Windows Operating System > Reporter: saravanan > > I wrote one sample program to test the caching of preparestatement for dynamic queries. > Code Snippet:- > Map lParam = new HashMap() ; > lParam.put("query", "select * from T1") ; > sqlMap.queryForList("getObjects", lParam) ; > sqlMap.queryForList("getObjects", lParam) ; > Log:- > [main] 07/23/09 00:56:44.671 DEBUG com.ibatis.common.jdbc.SimpleDataSource :Created connection 7804298. > [main] 07/23/09 00:56:44.674 DEBUG java.sql.Connection :{conn-100000} Connection > [main] 07/23/09 00:56:44.677 DEBUG java.sql.Connection :{conn-100000} Preparing Statement: select * from T1 > [main] 07/23/09 00:56:44.720 DEBUG java.sql.PreparedStatement :{pstm-100001} Executing Statement: select * from T1 > [main] 07/23/09 00:56:44.720 DEBUG java.sql.PreparedStatement :{pstm-100001} Parameters: [] > [main] 07/23/09 00:56:44.720 DEBUG java.sql.PreparedStatement :{pstm-100001} Types: [] > [main] 07/23/09 00:56:44.747 DEBUG com.ibatis.common.jdbc.SimpleDataSource :Returned connection 7804298 to pool. > [main] 07/23/09 00:56:44.747 DEBUG com.ibatis.common.jdbc.SimpleDataSource :Checked out connection 7804298 from pool. > [main] 07/23/09 00:56:44.747 DEBUG java.sql.Connection :{conn-100003} Connection > [main] 07/23/09 00:56:44.748 DEBUG java.sql.Connection :{conn-100003} Preparing Statement: select * from T1 **************Why Preparing Statement again********** > [main] 07/23/09 00:56:44.748 DEBUG java.sql.PreparedStatement :{pstm-100004} Executing Statement: select * from T1 > [main] 07/23/09 00:56:44.748 DEBUG java.sql.PreparedStatement :{pstm-100004} Parameters: [] > [main] 07/23/09 00:56:44.748 DEBUG java.sql.PreparedStatement :{pstm-100004} Types: [] > [main] 07/23/09 00:56:44.749 DEBUG com.ibatis.common.jdbc.SimpleDataSource :Returned connection 7804298 to pool. > [main] 07/23/09 00:56:44.750 DEBUG com.ibatis.common.jdbc.SimpleDataSource :Checked out connection 7804298 from pool. > If i add sqlmap.startTransaction() in the begining of the code, preparestatement is getting cached. But why should we need to begin a transaction to cache preparestatements. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ibatis.apache.org For additional commands, e-mail: dev-help@ibatis.apache.org