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.


      

Reply via email to