"Can't get primary key from temporary id" :(

From: Joseph Schmidt (joseph_schmidt7..ahoo.com)
Date: Tue Apr 07 2009 - 18:26:52 EDT

  • Next message: Aristedes Maniatis: "Re: "Can't get primary key from temporary id" :("

    I'm getting the following error:
    ------------
    Can't get primary key from temporary id
    ------------

    while trying to access the 'id' of a newly created object entity A.
    I need this 'id' to write the value together with some other fields in some other object entity B inside the same transaction. Between A and B there's no relationship (I'm using MySQL as a DB and CayenneM5).

    Is there's some API I'm missing or using wrongly for this scenario?
    I used DataObjectUtils.pkForObject() to get the 'id'.

    Or how to solve this scenario - it is pretty common to need inside the sam transaction values from newly created entities - e.g. for audit/logging or other purposes.

    thanks,
    Joseph.

          



    This archive was generated by hypermail 2.0.0 : Tue Apr 07 2009 - 18:27:30 EDT