Re: Problem with foreign keys on DB and JPA delete

2008-07-04 Thread Beniamin Mazan
Michael Dick wrote: > > FWIW Configuring the constraint update manager can be done by adding this > property to persistence.xml : > > > > -mike > > With this property set to "constraint" I got exception on persist cause EM persist at first descendent object (voice_mail) with no main objec

Re: Problem with foreign keys on DB and JPA delete

2008-07-03 Thread Michael Dick
FWIW Configuring the constraint update manager can be done by adding this property to persistence.xml : -mike On Thu, Jul 3, 2008 at 11:11 AM, Fay Wang <[EMAIL PROTECTED]> wrote: > Hi, >From the stack trace: > ... > > org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(Prepar

Re: Problem with foreign keys on DB and JPA delete

2008-07-03 Thread Fay Wang
Hi, From the stack trace: ... org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:73) at org.apache.openjpa.jdbc.kernel.OperationOrderUpdateManager.flushPrimaryRow(OperationOrderUpdateManager.java:162) at org.apache.openjpa.jdbc.kernel.Ope

RE: Problem with foreign keys on DB and JPA delete

2008-07-02 Thread Eric Nelson
Hi Beniamin. Two things to try: 1. Add CascadeType.REMOVE to your SubProduct annotation 2. Add @ForeignKey annotation to SubProduct just after the @JoinColumn annotation. We ran into an issue where OpenJPA was trying to delete the table that was referenced by the foreign key before deleting the