cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kienenberger <mkien...@gmail.com>
Subject Re: "Can't get primary key from temporary id" :(
Date Wed, 22 Apr 2009 17:03:23 GMT
Might be a long shot, but if you start a root transaction at the start
of PrePersist and then commit it in PostPersist, maybe that will work.

On Wed, Apr 22, 2009 at 12:57 PM, Joseph Schmidt
<joseph_schmidt71@yahoo.com> wrote:
>>  You might also take a look at the 3.0 lifecycles that Ari mentioned
>> in the issue, but my guess is that JPA lifecycles won't do what is
>> needed.
>
> I did. To be inside the same transaction for writing,  PrePersist would be
> the logical choice
> (from what I understood the docs). The very short documentation from here:
> http://cayenne.apache.org/doc/lifecycle-callbacks.html
> mentions that this happens "after ObjectId and ObjectContext are set"
>
> The problem is that at that moment tying to write(access the value of the
> PK) I still get the same error message like the title of this post. It looks
> like ObjectId does not have the PK at that moment yet :(.
>
>
> thanks,
> Joseph.
>
>

Mime
View raw message