Re: Primary key generation in cluster (PostgreSQL)

From: Andreas Hartmann (andrea..pache.org)
Date: Tue Jan 05 2010 - 06:34:58 EST

  • Next message: Martin Weber: "[ANNOUNCEMENT] Cayenne within another (different) framework"

    Hi Andrus,

    Am 05.01.10 09:06, schrieb Andrus Adamchik:
    > Yes, it is safe as long as the underlying DB guarantees atomic sequences.

    thanks a lot for your quick answer!

    Best regards,
    -- Andreas

    >
    > Andrus
    >
    > On Jan 5, 2010, at 1:35 AM, Andreas Hartmann wrote:
    >
    >> Hi Cayenne community,
    >>
    >> I'm using Cayenne 3.0M6.
    >>
    >> Is it safe to use the default primary key generation strategy with
    >> PostgreSQL in a web application cluster, with multiple JVMs accessing
    >> the same database?
    >>
    >> IIUC Cayenne fetches the next value from the sequence (which is then
    >> incremented by 20) and uses these 20 keys. So theoretically, no two
    >> Cayenne instances should ever use the same key. Is this assumption
    >> correct?
    >>
    >> Thanks a lot for any hints and best regards,
    >>
    >> -- Andreas
    >>
    >>
    >>
    >>
    >> --
    >> Andreas Hartmann, CTO
    >> BeCompany GmbH
    >> http://www.becompany.ch
    >> Tel.: +41 (0) 43 818 57 01
    >>
    >>
    >
    >

    -- 
    Andreas Hartmann, CTO
    BeCompany GmbH
    http://www.becompany.ch
    Tel.: +41 (0) 43 818 57 01
    



    This archive was generated by hypermail 2.0.0 : Tue Jan 05 2010 - 06:36:05 EST