Re: Re: Cayenne not taking account of PKs created by external SQL script

From: Michael Gentry (blacknex..mail.com)
Date: Mon Oct 23 2006 - 09:13:17 EDT

  • Next message: Øyvind Harboe: "Re: localObject(), Java null pointers and database NULL"

    Just to jump into the fray late ...

    The safest thing to do is have your non-Cayenne stuff should use the
    same PK generation method as Cayenne. If it is set up to use
    sequence, get your PK from the sequence. If using the auto PK table,
    get your PK from the table. Everyone will play along nicely then.

    /dev/mrg

    On 10/19/06, Kevin Menard <kmenar..ervprise.com> wrote:
    > My only addition to this is that you may need to limit the number of
    > keys Cayenne caches (by default: 20) to just one. Otherwise, Cayenne
    > will assume that block of IDs are valid for use.
    >
    > --
    > Kevin Menard
    > Servprise International, Inc.
    > "Remote reboot without pulling the plug" -- http://www.servprise.com
    >
    >
    >
    > Tore Halset wrote:
    > > On Oct 19, 2006, at 11:17, Rashid Khan wrote:
    > >
    > >> Is there any way I can make cayenne aware of the records that have been
    > >> created manually?
    > >
    > > You can update AUTO_PK_SUPPORT or pk sequence created by cayenne. You
    > > should update this before inserting to grap a block of primary key
    > > values just as cayenne does.
    > >
    > > Or you could use cayenne to "manually insert" that record.
    > >
    > >> Or better yet, can I get rid of Cayenne Auto PK support completely?
    > >
    > > Take a look at database generated keys. Not all databases and jdbc-
    > > driver support them.
    > >
    > > - Tore.
    > >
    >



    This archive was generated by hypermail 2.0.0 : Mon Oct 23 2006 - 13:52:50 EDT