Re: Generating primary key locally without extra tables

From: Øyvind Harboe (oyvind.harbo..ylin.com)
Date: Wed Jun 21 2006 - 09:16:08 EDT

  • Next message: Gentry, Michael \(Contractor\): "RE: MySql auto generated PK"

    On 6/21/06, Gentry, Michael (Contractor) <michael_gentr..anniemae.com> wrote:
    > I actually looked into making a PK generator that required no DB access, but when I looked into it, Java didn't support everything I wanted without resorting to JNI and C code. Of course, I was more ambitious in what I was thinking. I wanted it to be similar to what I could do in EOF (hundreds of keys/sec).
    >
    > Does anyone here know if Java 1.5 supports obtaining the process ID natively? I think that was my stumbling point before. I was trying to make a key that contained server IP, process ID, timestamp, and counter. Maybe it is time to consider this again. If I could produce a unique string all the time like that, it would make a nice PK generator and your PKs would have some meaning (that is me with my production support hat on).

    It sounds like you are looking for something like:
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/UUID.html

    > As to your questions ...
    >
    > A) My gut feeling tells me that wouldn't be a good idea.

    Could you be more specific?

    We're replacing a horrid .asp + MS Access application, which
    inevitably leads to some nausea :-)

    > B) You could do that, but it seems pretty problematic to me.

    More specific?

    > Maybe some others will have a few good ideas ...

    If I can have an MSAccess & Oracle & MS SQL adapter that supports
    server generated keys, then that will also solve my problems. Might be
    a bit quixotic though. :-)

    -- 
    Øyvind Harboe
    http://www.zylin.com
    



    This archive was generated by hypermail 2.0.0 : Wed Jun 21 2006 - 09:16:31 EDT