Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 68872 invoked from network); 25 Jan 2007 18:19:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jan 2007 18:19:50 -0000 Received: (qmail 10179 invoked by uid 500); 25 Jan 2007 18:19:55 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 9627 invoked by uid 500); 25 Jan 2007 18:19:54 -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 9616 invoked by uid 99); 25 Jan 2007 18:19:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jan 2007 10:19:54 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [217.156.99.222] (HELO relay.kepler-rominfo.com) (217.156.99.222) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jan 2007 10:19:45 -0800 Received: from localhost (mail.kepler.ro [127.0.0.1]) by mail.kepler-rominfo.com (Postfix) with ESMTP id 0E24E24E6 for ; Thu, 25 Jan 2007 20:19:22 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at kepler-rominfo.com Received: from relay.kepler-rominfo.com ([127.0.0.1]) by localhost (mail.kepler.ro [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EMGFq2S+NfyA for ; Thu, 25 Jan 2007 20:19:21 +0200 (EET) Received: from coan (unknown [192.168.16.13]) by mail.kepler-rominfo.com (Postfix) with SMTP id E3E77B98 for ; Thu, 25 Jan 2007 20:19:21 +0200 (EET) Message-ID: <017f01c740ad$52035b20$0d10a8c0@coan> From: "Cornel Antohi" To: References: <003601c73e45$5eac8aa0$0d10a8c0@coan> <16178eb10701220909x2c3c7fd0jcdb99b825e0dd7e1@mail.gmail.com> <46d2280d0701230211w5d80b8dob7cbb135dff60659@mail.gmail.com> <001201c74053$2aa5f150$0d10a8c0@coan> <46d2280d0701250721u3e40d0b7w21d56d2ea9044bde@mail.gmail.com> <011401c7409e$9bec3ef0$0d10a8c0@coan> <16178eb10701250855q45945e35pe3cbbc5ca176173d@mail.gmail.com> Subject: Re: Autocommit not properly handled in Ibatis. Date: Thu, 25 Jan 2007 20:19:15 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 X-Virus-Checked: Checked by ClamAV on apache.org Hi Clinton, Murphy's law is validated again: I am using Oracle :( If I am using in a method N SELECT queries with commitRequired=true, iBATIS makes N commit() (one at the end of each query), right? Do you have any clue / recommendation how to minimize this overhead using iBATIS + Oracle? Thank you, Cornel ----- Original Message ----- From: "Clinton Begin" To: Sent: Thursday, January 25, 2007 6:55 PM Subject: Re: Autocommit not properly handled in Ibatis. > In hindsight I wish I had made the default commitRequired=true... > > I believe the only database that really suffers from unecessary > commits is Oracle. The other RDBMS are actually pretty good about not > incurring additional overhead, and in fact Sybase drivers I've used > demand that either commit or rollback be called in all cases except > AutoCommit of course. > > Anyway, unless you're using Oracle, feel free to make your lives > easier by just setting commitRequired=true.. :-) > > Clinton > > On 1/25/07, Cornel Antohi wrote: >> >> >> Hi Koka, >> >> In case of iBATIS commitRequired=false, if you execute SELECT statements, >> they are grouped into a transaction that "is terminated by a call to >> either >> the method commit or the method rollback" ... because iBATIS never calls >> commit() or rollback() it means that iBATIS do not handle properly the >> transactions, right? >> >> >> Thank you, >> Cornel >> >> >> ----- Original Message ----- >> From: Koka Kiknadze >> To: user-java@ibatis.apache.org >> Sent: Thursday, January 25, 2007 5:21 PM >> Subject: Re: Autocommit not properly handled in Ibatis. >> >> >> >> > >> > >> > In iBATIS SELECT case, no commit or rollback is executed ... >> > >> > Question: >> > How do you interpret this fact? >> > >> >> Not sure what kind of interpretation you ask for ;) >> >> Again, if the code looks like (you can leave out startTransaction / >> commitTransaction in defaultAutocommit=true mode, as iBatis will >> internally >> add those for any SQL statement) : >> sqlMapClient.startTransaction(); >> sqlMapClient..queryFor...(); >> sqlMapClient.commitTransaction(); >> >> Underlying connection object's commit() method is NOT called if >> commitRequired property is set to false (it would get called if it were >> insert/update etc.), and vice versa - connection.commit() IS called if >> commitRequired = true. Setting commitRequired =false saves extra commit >> calls when no data has changed. >> >> >> >> >> >> >>