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 <[email protected]> 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. > >
