Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 46304 invoked from network); 23 May 2005 17:53:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 May 2005 17:53:45 -0000 Received: (qmail 83348 invoked by uid 500); 23 May 2005 17:53:39 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 83307 invoked by uid 500); 23 May 2005 17:53:39 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 83290 invoked by uid 99); 23 May 2005 17:53:39 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of oliver.zeigermann@gmail.com designates 64.233.184.194 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (64.233.184.194) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 23 May 2005 10:53:37 -0700 Received: by wproxy.gmail.com with SMTP id 71so2022105wri for ; Mon, 23 May 2005 10:53:35 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=CHjwHpnzH2AqROX4xix2i9oFwu2HBCLnHspH6JBpcKUP2rFc5EM0uV8LLLgbj21d7I04QCvL520LfqvV5PlfjJr3aGugII8vBD1UeyEc7613lioU2SQNfIOrw/1IaClKk9LNDmEG0URoAp25WhxhYfz97TBPGyA8p/czTaD0qS0= Received: by 10.54.16.60 with SMTP id 60mr3354547wrp; Mon, 23 May 2005 10:53:35 -0700 (PDT) Received: by 10.54.101.4 with HTTP; Mon, 23 May 2005 10:53:35 -0700 (PDT) Message-ID: <9da4f45205052310535cc0ad60@mail.gmail.com> Date: Mon, 23 May 2005 19:53:35 +0200 From: Oliver Zeigermann Reply-To: ozeigermann@apache.org To: Jakarta Commons Users List Subject: Re: [transaction] Duplicate TX id's In-Reply-To: <4291E6C2.2020506@davidkarlsen.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <428DE354.3040407@davidkarlsen.com> <9da4f4520505200628603d34e7@mail.gmail.com> <428F5E5E.2070705@davidkarlsen.com> <9da4f45205052305323ab0a2f1@mail.gmail.com> <4291E6C2.2020506@davidkarlsen.com> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 5/23/05, David J. M. Karlsen wrote: > Oliver Zeigermann wrote: > > On 5/21/05, David J. M. Karlsen wrote: > > > >>Hmm, yeah, but still - I cannot see why txId should be unique, the code= is: > >> > >>public String generatedUniqueTxId() throws ResourceManagerSystemExcepti= on { > >> assureRMReady(); > >> String txId; > >> synchronized (globalTransactions) { > >> do { > >> txId =3D Long.toHexString(System.currentTimeMillis); > >> // XXX busy loop > >> } while (getContext(txId) !=3D null); > >> } > >> return txId; > >> } > >> > > > > > > It will if you actually use the id to start a new transaction. In this > > case getContext(txId) will not return null and the procedure will be > > repeated. > It only ensures that you are not given a txId *in use* (eg. started). > Several equal txId maybe produced by this method - and worse - you will > only discover this when you try to start the supposedly unique TX. Thus, > it is broken... It should, as the name implies, generate truly unique id'= s. I disagree. The name implies that it generates a truly unique *tx* id, i.e. a tx id not currently used by any transaction which it does. =20 > >>you can apply my patch. > >>It uses doomdark.org 's UUIDGenerator. (the site is down at the moment)= . > > > > > > I would prefer if you simply generated your ids using this generator > > without changing the file resource manager code for two reasons: > that's what I'm doing in my app. (Providing the ID's myself, and not > calling generateUniqueID). >=20 > > > > (1) The above code is not broken > I beg to differ. >=20 > > (2) Changing the code would introduce a new dependency to another lib > True, that is bad. I'll put the generator code into another method that > we may call. OK? Depends on the original license of the code.=20 > > (3) The lib's licencse is unclear to me > I saw it included in some sandbox jakarta code - but that does not > neccessarily mean the license is OK. I could not even check what license it has. Which on is it? Still not convinced ;) Oliver --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org