Re: Inconsistent behaviour with Bi-directional One to Many Mapping.

2009-04-02 Thread Pinaki Poddar
> However > > didnt solve the issue.. That does not sound good. Please note that the property name should be "openjpa.jdbc.SchemaFactory" and not "openjpa.jdbc.Schemafactory". Please post a self-contained test case + domain class + persistence.xml + assertion failure stack trac for further in

Re: Inconsistent behaviour with Bi-directional One to Many Mapping.

2009-04-02 Thread srini.krish
Hi Pinaki, Thanks a lot for your help.. The property helped me solve the issue.. However didnt solve the issue.. Best Regards, Srini On Fri, Apr 3, 2009 at 10:49 AM, Pinaki Poddar (via Nabble) wrote: > Hi, >   OpenJPA can reorder the SQL to honor the existing foreign key constraints > in

Re: Inconsistent behaviour with Bi-directional One to Many Mapping.

2009-04-02 Thread Pinaki Poddar
Hi, OpenJPA can reorder the SQL to honor the existing foreign key constraints in the database schema. But you need to tell OpenJPA to read the foreign key information from the schema. To do this The other possibility is to choose an update strategy that maintains the SQL in in-memory op

Re: Inconsistent behaviour with Bi-directional One to Many Mapping.

2009-04-02 Thread Paul Copeland
I'm not clear on the use case for @ForeignKey (i.e., what problem it is meant to solve). But surely it should not be necessary to use an OpenJPA extension like @ForeignKey to to get correct behavior of a core part of the JPA specification. Srini can you tell us what version of OpenJPA you are

Re: Inconsistent behaviour with Bi-directional One to Many Mapping.

2009-04-02 Thread Miłosz Tylenda
Srini, I think you need to specify the @ForeignKey annotations on your entities. You will find more details in the manual: http://openjpa.apache.org/builds/1.2.1/apache-openjpa-1.2.1/docs/manual/manual.html#ref_guide_mapping_jpa_fk Regards, Milosz > Hi Paul, > Thanks for your suggestion.. Bu

Re: Inconsistent behaviour with Bi-directional One to Many Mapping.

2009-04-01 Thread srini.krish
Hi Paul, Thanks for your suggestion.. But even after implementing your suggestion I get the same result.. It persists once and next time it fails.. its inconsistent.. I made the following changes to the mapping.. @ManyToOne (optional=false, CascadeType.ALL) Is this a defect? Best regards, Srin

Re: Inconsistent behaviour with Bi-directional One to Many Mapping.

2009-04-01 Thread Paul Copeland
Does it make any difference if you put the CascadeType.ALL on both sides? Does it make any difference if you put optional=false on the ManyToOne ? @ManyToOne (optional=false, CascadeType.ALL) On 4/1/2009 10:29 AM, srini.krish wrote: Hi , I am trying to create a bidirectional one to many mappi