Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 12626 invoked from network); 17 Oct 2006 06:58:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Oct 2006 06:58:47 -0000 Received: (qmail 70322 invoked by uid 500); 17 Oct 2006 06:58:45 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 70304 invoked by uid 500); 17 Oct 2006 06:58:45 -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 70293 invoked by uid 99); 17 Oct 2006 06:58:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Oct 2006 23:58:45 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of carsten.zeitz@gmx.de designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 16 Oct 2006 23:58:43 -0700 Received: (qmail 29485 invoked by uid 0); 17 Oct 2006 06:58:22 -0000 Received: from 195.145.229.203 by www080.gmx.net with HTTP; Tue, 17 Oct 2006 08:58:22 +0200 (CEST) Content-Type: text/plain; charset="iso-8859-1" Date: Tue, 17 Oct 2006 08:58:22 +0200 From: "Carsten Zeitz" In-Reply-To: <20061016204602.30070@gmx.net> Message-ID: <20061017065822.65860@gmx.net> MIME-Version: 1.0 References: <20061016204602.30070@gmx.net> Subject: Re: Problem inserting many rows To: user-java@ibatis.apache.org X-Authenticated: #851753 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, I found the problem myself. The iBATIS transaction manager uses a throttle for the opened transactions. This throttle is limited to 32. Each beginTransaction() increments a counter, an if the limit is reached, no more transactions can be startet. A simple commitTransaction() does not decrement the counter. The endTransaction() finally solves this problem. Carsten -------- Original-Nachricht -------- Datum: Mon, 16 Oct 2006 22:46:02 +0200 Von: "Carsten Zeitz" An: user-java@ibatis.apache.org Betreff: Problem inserting many rows > Hi, > > these are my first steps using iBATIS. I'd like to use it in an > application to write incoming messages to a MySQL database. I just make a simple test > to check the performance. I use a loop to insert 2000 message objects. The > result: It inserts 10, then waits, insert another 10, waits, ... and after > 32 message it hangs up. > > Now where is my problem ??? > > Here my configuration: > > > > > > > > > > > > > > > > > > > > > > > INSERT INTO messages ( timeStamp, ip, text ) > VALUES ( #timeStamp#, #ip#, #text# ) > > > > > > Reader reader = Resources.getResourceAsReader("etc/ibatis-config.xml"); > SqlMapClient sqlmap = SqlMapClientBuilder.buildSqlMapClient(reader); > > Message tMessage = new Message(); > > for( int i = 0; i < 2000; i++ ) > { > sqlmap.startTransaction(); > sqlmap.insert("insertMessage", tMessage ); > System.out.println("Insert " + i); > sqlmap.commitTransaction(); > } > > > I hope you can help me! > > Thanks a lot, > Carsten > > > -- > Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! > Ideal f�r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal f�r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer