RE: Using UUID with Cayenne. Was: Re: Cayenne release schedule

From: Gentry, Michael \(Contractor\) ("Gentry,)
Date: Mon Apr 18 2005 - 11:48:31 EDT

  • Next message: Erdinc Kocaman: "RE: Cayenne release schedule"

    Well, I wasn't thinking of trying to debug a UUID. I was thinking it could be useful in debugging. It would contain the application instance that did the insert and which machine, etc.

    Here is kind of the problem I ran into (from the page you cite):

    "Native libraries written in C, accessed using JNI, that are needed to be able to obtain ethernet MAC addresses (needed for time/location - based UUID generation)."

    I was wanting to avoid JNI (especially for Windows). I wanted a 100% Java solution.

    Also, as you state, it makes it much easier to sync your database with another (no PK conflicts) and you never have to ask the DB for a PK (bonus).

    I'm guessing we might have to wait on 1.5 for a pure Java solution. Also, given a code snippet that Mikaël Cluseau posted on the developer list, I think Java 1.5 is going to scare me. Looks C++ish. :-)

    /dev/mrg

    -----Original Message-----
    From: Adrian Wiesmann [mailto:awiesman..omap.org]
    Sent: Monday, April 18, 2005 11:38 AM
    To: cayenne-use..bjectstyle.org
    Subject: Using UUID with Cayenne. Was: Re: Cayenne release schedule

    On Mon, 18 Apr 2005 11:09:16 -0400
    "Gentry, Michael \(Contractor\)" <michael_gentr..anniemae.com> wrote:

    > The UUID concept appeals to me, too. I looked at doing something
    > similar using Java 1.4.2, but I couldn't find a way to get the process
    > ID without resorting to C via JNI. Does anyone know of a 1.4.2 way of
    > doing this?

    I am not sure what you are trying to debug with the UUID, but there is a
    Java library I am using which does UUID's according the IETF UUID specs.
    Very fast and very easy to use:

    <http://www.doomdark.org/doomdark/proj/jug/>

    It looks as if Apache Derby contains UUID's as well btw.

    I use UUID's for another reason. UUID's are generated even before the
    first persist or even a lookup on the database is made. There are no
    problems with multiple virtual types on one physical table. They are
    unique and a table merge becomes a childs play, just think about road
    warriors synching their laptop with the master DB. etc...

    Currently I am using varchar(36) and write the UUID in these fields as a
    string :/ . But I a) would love to have native UUID support in Cayenne and
    b) would love to be able to have some way of create my UUID PK's in
    Cayenne on my own. Just as transparent as the primary key support that is
    in Cayenne already.

    Has anyone of you worked in Cayenne like that?

    Regards,
    Adrian



    This archive was generated by hypermail 2.0.0 : Mon Apr 18 2005 - 11:48:36 EDT