openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Fuchs <Markus.Fu...@Sun.COM>
Subject Re: Embedded entities are deleted last
Date Thu, 05 Jul 2007 19:49:18 GMT
Hi Christian,

> When I try to delete the Shape, I get a constraint violation because
> the Shape itself is deleted before the entry in Circle.  But maybe
> that is related to issueOPENJPA-235...  
This problem is not related to OPENJPA-235. Foreign key constraints 
between secondary and primary tables are handled differently from 
foreign key constraints that exist because of relationships. Both 
classes implementing flush behavior in OpenJPA 
(OperationOrderUpdateManager and ConstraintUpdateManager) execute 
deletes from secondary tables *before* any operations on primary tables. 
Could you provide a simple test case to reproduce the error?

Thanks,

-- markus.
> The sequence of SQL statements
> I get is:
>
> I first insert:
> INSERT INTO SHAPE...
> CALL IDENTITY()
> INSERT INTO CIRCLE...
> INSERT INTO SQUARE...
>
> then I delete:
> DELETE FROM SHAPE...
> DELETE FROM CIRCLE...
> DELETE FROM SQUARE...
>
> when I commit my transaction, I get:
> Integrity constraint violation F_CIRCLE_1 table: CIRCLE in statement
> [DELETE FROM SHAPE...]} [code=-8, state=23000]
>
> I tried defining secondary tables in the Shape object and specifying
> them directly in the embeddable objects. The result is exactly the
> same...
>
> If you feel like having the code of the objects would be useful, just
> tell me and I will post it.
>
> Thanks again for your time!
>
>
> Christian

Mime
View raw message