DB2 cached sequence numbers

From: Derek Rendall (dere..sure.com)
Date: Wed Oct 20 2004 - 20:58:46 EDT

  • Next message: Derek Rendall: "Re: DB2 cached sequence numbers"

    Hi

    I notice that the modeler states that the "Customise primary key generation"
    is "currently ignored by all adapters except Oracle". The application I am
    looking to convert to Cayenne has its own DB independant way of creating
    ids. Rather than try to adapt it to the "new" data layer, I thought I would
    go with DB2 sequences (we wont be shifting DB vendors now). What can I do to
    stop each ID being 20 bigger than the last? I could change the sequences to
    increment by 1 - seems a bit of a pity.

    Can I (just) create and use my own subclass of DB2PkGenerator, implementing
    the pkCacheSize similar to that of the OraclePkGenerator? If so, how do I
    plug it in? Or do I have to checkout and change the DB2PkGenerator in
    Cayenne itself?

    Note: I am not worried (for now) about making sure that any changes to the
    cached PK size is reflected in any sequence SQL generation code - I am happy
    to manually make sure that I sync any changes from the default of 20 (I will
    probably stick with 20 anyway :-).

    Thanks

    Derek



    This archive was generated by hypermail 2.0.0 : Wed Oct 20 2004 - 20:58:50 EDT