openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <ppod...@apache.org>
Subject Re: Savepoint issue with OpenJPA
Date Sat, 22 Dec 2012 01:25:19 GMT
> of course the commit would have failed. The reason would be that the child
table insert is fired first before the parent table insert. 

Not necessarily correct. 

As I had mentioned, OpenJPA is capable of ordering the SQL statements such
that the existing foreign key constraints are honored. This facility
requires that OpenJPA is instructed to read existing foreign key constraints
from the database schema. A common way is to specify
      <property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(ForeignKeys=true)"/>

If you observe that OpenJPA fails to recorder the SQL despite such a
setting, then we will consider that to be a defect.

> If you can let me know entities in the OpenJPA source code that have
> foreign constraints enforced
OpenJPA has 4000+ test cases and some of them, I am sure, uses foreign keys. 

> the topological sort is not being done based on foreign key constraints as
> you would normally expect. 
what is the basis of this statement? The savepoint feature is sparingly
used, so I am not certain, but I would presume that whether OpenJPA reorders
the SQL statements during flush/commit has nothing to do with whether
savepoint feature has been used or not.



-----
Pinaki Poddar
Chair, Apache OpenJPA Project
--
View this message in context: http://openjpa.208410.n2.nabble.com/Savepoint-issue-with-OpenJPA-tp7581548p7582358.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.

Mime
View raw message