Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 86036 invoked from network); 25 Jul 2007 17:11:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jul 2007 17:11:52 -0000 Received: (qmail 12363 invoked by uid 500); 25 Jul 2007 17:11:53 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 12343 invoked by uid 500); 25 Jul 2007 17:11:53 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 12332 invoked by uid 99); 25 Jul 2007 17:11:53 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2007 10:11:53 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of mprudhomapache@gmail.com designates 64.233.162.228 as permitted sender) Received: from [64.233.162.228] (HELO nz-out-0506.google.com) (64.233.162.228) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2007 10:11:51 -0700 Received: by nz-out-0506.google.com with SMTP id q3so209140nzb for ; Wed, 25 Jul 2007 10:11:30 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer:sender; b=PhUIxCoHLkPq1UaJLDLnOwDNFIfY2AiRVVypyEW1PP2OZphwUZsyh4GukD/LlRpepZxmBwK1T57yiT/5rNKBO1gtkKND6d7LC8XcMK8RDkYxO7Lw6tp6OmZEo48N8c8+Ih+t7eNZOqPoV9hY2Krxmkp+1d5Xv1yBY3Ttz2BrQ5M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer:sender; b=IUGKyljF3VB+bENhgG3tw5siH6wDoHKrIpF2TtjPr2XTE8+aF0fdVxxbvB44zrjjZI6OQIKxx2so/X6D/zsVm/E0ieb7lYtSpzUR+cDaCRyJD78LVaazKDmQNT6rMrfJqqNjS2+d93JoF7y4ob/9jDYZBoGsu6PA3AFS1p+oXu8= Received: by 10.141.52.5 with SMTP id e5mr254997rvk.1185383490092; Wed, 25 Jul 2007 10:11:30 -0700 (PDT) Received: from ?192.168.1.10? ( [66.248.222.34]) by mx.google.com with ESMTPS id b8sm1367509rvf.2007.07.25.10.11.28 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 Jul 2007 10:11:28 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <7262f25e0707250912k171e208do35cd9e315f4a54f@mail.gmail.com> References: <46A75A37.6000202@torrez.us> <7262f25e0707250912k171e208do35cd9e315f4a54f@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Marc Prud'hommeaux Subject: Re: uuid-string not generating unique ids Date: Wed, 25 Jul 2007 10:11:09 -0700 To: dev@openjpa.apache.org X-Mailer: Apple Mail (2.752.3) Sender: Marc Prud'hommeaux X-Virus-Checked: Checked by ClamAV on apache.org Patrick- I bet you are right. Your analysis of the problem looks correct to me. On Jul 25, 2007, at 9:12 AM, Patrick Linskey wrote: > Hi, > > Based on a quick read, it looks like maybe the problem is > UUIDGenerator.java:178. I suspect that we should be changing that to > obtain another newTime inside the if block after incrementing the > sequence. However, I'm not an expert in this algorithm; does anyone > have a better grasp on it than do I? > > -Patrick > > On 7/25/07, Elias Torres wrote: >> >> Hi, >> >> First off, I want to say thank you for the hard work this >> community has >> put on this JPA implementation. I'm extremely eager in getting to >> know >> it better and hopefully put it to good use in some of the projects >> I'm >> currently working on at IBM. If all goes well, I'll be asking some of >> the harder questions later and possibly discuss new features not >> currently implemented. >> >> Now if you could please help me out with a small issue I'm having >> with >> uuid generation. >> >> @Entity >> public class Foo { >> >> @Id >> @GeneratedValue(strategy=GenerationType.AUTO, generator="uuid- >> string") >> private String id; >> >> } >> >> CREATE TABLE Foo ( >> id VARCHAR(16) NOT NULL >> } >> >> If I do one em.persist() it works just fine. However, if I do a a >> whole >> list of them, I get exceptions (duplicate). If I enable logging I can >> see they are all using the same id during INSERT. I stepped a bit >> through the code and noticed that uuid-string doesn't get generated >> while em.persist(), but much later while committing/flushing. I then >> looked a bit (just a bit) at the UUID generator code and noticed that >> the bytes are not changing much (maybe only the first two), but >> again, >> that was while debugging, so I'm assuming I have a supa-fast machine. >> >> Anybody running into the same problem? Any suggestions? >> >> -Elias >> > > > -- > Patrick Linskey > 202 669 5907