Re: Oracle trying to get key from sequence (DUAL)--how to stop?

From: Michael Gentry (mgentr..asslight.net)
Date: Fri Jul 31 2009 - 09:23:47 EDT

  • Next message: Lawrence Gerstley: "Re: Oracle trying to get key from sequence (DUAL)--how to stop?"

    If you select ENTRYSTATE (the DbEntity) in Cayenne Modeler and look
    under the Entity tab, what do you see for the Primary Key settings?

    On Fri, Jul 31, 2009 at 1:40 AM, Lawrence Gerstley<lawger..mail.com> wrote:
    > Hello,
    >
    > I've got a system where I need to populate my primary keys directly with
    > GUIDs, rather than letting Cayenne do it. For the most part, this is working
    > fine--I've exposed the keys in the Object layer, and set them when I create
    > a new object. However, there still seem to be calls to an Oracle sequence
    > for a key that I'm setting. That is, I've got:
    >
    > ENTITY
    >        -- EntityCode (PK)
    >        -- EntryStateID (FK)
    > ENTRYSTATE
    >        -- EntryStateID (PK)
    >
    > I create the entity, set the Entity's key, create the EntryState, set the
    > EntryState's key, and attach the EntryState to the Entity
    > (entity.setToEntryState(entryState). I check all of the values both by
    > checking the objects individually, and through reference (e.g.,
    > entity.getToEntryState.getEntryStateId()). Regardless, when I go to commit
    > the changes consisting of the new objects being added to the data context, I
    > get:
    >
    > SELECT entryState.nextval FROM DUAL;
    >
    > I could create an Oracle sequence, but I don't want this--I want to be
    > responsible for the keys myself. Can you help me find where this
    > auto-sequence dependency is coming from, and how to stop it? I'd rather it
    > just fails than try to get a key through some sequence.
    >
    > Thanks,
    >
    > Lawrence
    >
    >



    This archive was generated by hypermail 2.0.0 : Fri Jul 31 2009 - 09:37:29 EDT