Re: Primary key generation in cluster (PostgreSQL)

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Jan 05 2010 - 03:06:53 EST

  • Next message: Andreas Hartmann: "Re: Primary key generation in cluster (PostgreSQL)"

    Yes, it is safe as long as the underlying DB guarantees atomic
    sequences.

    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
    >
    >



    This archive was generated by hypermail 2.0.0 : Tue Jan 05 2010 - 03:07:30 EST