Hi,

It sounds like OpenJPA doesn't know about your foreign key constraints
on that relationship, and is therefore re-ordering, and sometimes that
results in inappropriate ordering.

-Patrick

On 10/12/07, Stuart Bedoll <[EMAIL PROTECTED]> wrote:
>
>
> I am trying to store a simple parent/child object model in our Oracle DB.
> With openjpa 1.0 snapshot (from july) this works 60% of the time.  The
> other 40% of the time the Insert  sql for the child object is executed
> before the Insert sql of the parent. Thus, the parent key not found sql
> exception occurs. I moved up to openjpa 1.0 release and it now happens
> every time.  I followed the example in the Users manual example 12.17 using
> Company as the parent and Magazine as the child object.
>
> Child object has this annotation:
>
> @ManyToOne(fetch=FetchType.LAZY, cascade=CascadeType.PERSIST)
> @JoinColumn(name="PUB_ID")
> private Company publisher;
>
>
> Parent object has this annotation:
>
> @OneToMany(mappedBy="publisher", cascade=CascadeType.PERSIST)
> private Collection<Magazine> mags;


-- 
Patrick Linskey
202 669 5907

Reply via email to