Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 20821 invoked from network); 15 Sep 2006 14:15:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Sep 2006 14:15:15 -0000 Received: (qmail 95446 invoked by uid 500); 15 Sep 2006 14:15:13 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 95422 invoked by uid 500); 15 Sep 2006 14:15:13 -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 95411 invoked by uid 99); 15 Sep 2006 14:15:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Sep 2006 07:15:12 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of larry.meadors@gmail.com designates 64.233.182.185 as permitted sender) Received: from [64.233.182.185] (HELO nf-out-0910.google.com) (64.233.182.185) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Sep 2006 07:15:00 -0700 Received: by nf-out-0910.google.com with SMTP id l23so2512550nfc for ; Fri, 15 Sep 2006 07:14:33 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=qDM0F71rZL0s+Ezx1kKXA1KvyxS+qNTFSOZ8R0XP8xd3g3oRz8rYYMc4Hbb9zoWA8uD0judaDtmlELfy3j/8aCfiOaf9iLgtlKdFIJ7o6igD2gza7ogzk+IVcThzE1ZBaIypIVfd2OxcfJwRxoHVXLedxcsd12kDUwL5ELhsDXY= Received: by 10.49.93.13 with SMTP id v13mr13369725nfl; Fri, 15 Sep 2006 07:14:32 -0700 (PDT) Received: by 10.49.19.19 with HTTP; Fri, 15 Sep 2006 07:14:32 -0700 (PDT) Message-ID: Date: Fri, 15 Sep 2006 08:14:32 -0600 From: "Larry Meadors" Reply-To: lmeadors@apache.org Sender: larry.meadors@gmail.com To: user-java@ibatis.apache.org Subject: Re: finding unique keys In-Reply-To: <1a9701c6d8d0$ab1030c0$0601a8c0@RIGCISERVER> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1a9701c6d8d0$ab1030c0$0601a8c0@RIGCISERVER> X-Google-Sender-Auth: a9e3cf2a29d42dea X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N One question: Why not just let the database do it and have it tell you the generated key? Larry On 9/15/06, Edwin Lukaweski wrote: > > > Hi: > > I have a situation for which I need some advice while using iBatis. > > What I would like to do is: > > 1) generate a unique UUID style value in my Java program > > 2) lock a table, say tabxx > > 3) SELECT on the table to see if the UUID exists as a key > > 4) if so, add 1 to the key and go to step 3 > > 5) if the key does NOT exist, insert the record > > 6) unlock the table > > Can anyone get me advice as to how to do this with iBatis? > > Thanks, very musch, in advance > > Edwin >