Re: PK problem with Postgre

From: Mike Kienenberger (mkienen..mail.com)
Date: Thu Apr 20 2006 - 11:18:33 EDT

  • Next message: Mike Kienenberger: "Creating Oracle constraints across schemas"

    Well, that could be the problem. You need to make sure that the
    cayenne model and the database are using the same value -- there's no
    "magic" that allows cayenne to figure this out.

    The default strategy is probably to use 20.

    If you're using sequences, my suggestion would be to explicitly say so
    in your model so you can control the increment interval.

    On 4/20/06, WONDER <mmmmmmmmm5..eb.de> wrote:
    > I changed the "INCREMENT BY 1" into "INCREMENT BY 3" in PostGreSQL.
    > The cayenne still increments by 1.
    > I think the default PK strategy does not use the seq correctly.
    >
    >
    >
    >
    > > ----- Original Message -----
    > > From: "Mike Kienenberger" <mkienen..mail.com>
    > > To: <cayenne-use..ncubator.apache.org>
    > > Sent: Thursday, April 20, 2006 4:32 PM
    > > Subject: Re: PK problem with Postgre
    > >
    > >
    > > On 4/20/06, Bryan Lewis <brya..aine.rr.com> wrote:
    > > > Here's my guess. Your image table had some existing data before you
    > > > added the sequence for Cayenne's use. When the modeler adds a sequence,
    > > > it defaults to a starting value of 200, with SQL like this:
    > > >
    > > > CREATE SEQUENCE pk_image START WITH 200 INCREMENT BY 20;
    > >
    > > Another thing to keep in mind is that EOF defaults to "INCREMENT BY 1"
    > > while Cayenne defaults to "INCREMENT BY 20". Not sure if it'll have
    > > any bearing on your situation.
    > >
    > >
    >
    >



    This archive was generated by hypermail 2.0.0 : Thu Apr 20 2006 - 11:18:58 EDT