Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 8330 invoked from network); 25 Jul 2007 18:13:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jul 2007 18:13:28 -0000 Received: (qmail 36918 invoked by uid 500); 25 Jul 2007 18:13:29 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 36849 invoked by uid 500); 25 Jul 2007 18:13:29 -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 36840 invoked by uid 99); 25 Jul 2007 18:13:29 -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 11:13:29 -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 plinskey@gmail.com designates 64.233.166.176 as permitted sender) Received: from [64.233.166.176] (HELO py-out-1112.google.com) (64.233.166.176) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2007 11:13:27 -0700 Received: by py-out-1112.google.com with SMTP id f31so563153pyh for ; Wed, 25 Jul 2007 11:13:06 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=f2Qz0tdAT50iR5tWYr16jKaC/KnQKWniMhBGpeo4KedWQnJWuqAdl3IdAd2wiuKsPlsc8y528OE1nBp1jZrGNq1kCTFUv5DmuRWVbuPjtMHsJhheumGgKBoMSre68G0oP8EucenWgWx2+znsPY7jCWYaYnsUjszespwBbO9moTI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=VsPLQgT2EDukRCcX27do+I3ejc1mLR+98pXYvCUoXcq5lQFFJLFlvXuqN3cHJLhSIDVzZzvZmjg94uTXU0RHrNhpKypu2WWCQQoRQPEgR0prTLloT++URcsE4iJ23dP1f1jlyLacQW96v0bz9QIyESWWfg1KCxgNdiWvZg0Caes= Received: by 10.35.125.20 with SMTP id c20mr9891450pyn.1185387186234; Wed, 25 Jul 2007 11:13:06 -0700 (PDT) Received: by 10.35.8.4 with HTTP; Wed, 25 Jul 2007 11:13:06 -0700 (PDT) Message-ID: <7262f25e0707251113u32b74695la9e4872549a09bc1@mail.gmail.com> Date: Wed, 25 Jul 2007 11:13:06 -0700 From: "Patrick Linskey" To: dev@openjpa.apache.org Subject: Re: uuid-string not generating unique ids In-Reply-To: <46A7925C.2010602@torrez.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46A75A37.6000202@torrez.us> <7262f25e0707250912k171e208do35cd9e315f4a54f@mail.gmail.com> <7262f25e0707251100q5f4d5bdvb8b646850c238de5@mail.gmail.com> <46A7925C.2010602@torrez.us> X-Virus-Checked: Checked by ClamAV on apache.org There have been a lot of changes since then, but things should be pretty compatible. If you've got a good test suite, I'd recommend switching to trunk and seeing what happens. -Patrick On 7/25/07, Elias Torres wrote: > > Thank you Patrick and Mark. I'm using 0.9.7, so I'm either patching it > or switching to trunk. Do you think it'd be safe (for an agile > development group) to switch to trunk from 0.9.7 or were there many big > changes since then? > > Anyways, thanks again. I'll ask a couple of other things later. > > -Elias > > Patrick Linskey wrote: > > I just committed a change that will maybe resolve the issue. Please > > let us know if you see it come up again. > > > > I also logged the issue as OPENJPA-296. > > > > -Patrick > > > > On 7/25/07, Marc Prud'hommeaux wrote: > >> 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 > >> > >> > > > > > -- Patrick Linskey 202 669 5907