openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpa_user <kommaraju.srini...@gmail.com>
Subject Incosistent Persist Operation
Date Tue, 22 Jul 2008 11:55:54 GMT

Hi 

I have a class A which has 3 ManyToOne references. When I try to persist A
the insert queries fired are inconsistent.
As a result entire persist opertation fails

Class A
{
  @ManyToOne(targetEntity="B.class",cascade=CascadeType.ALL)	
  B b;
   @ManyToOne(targetEntity="C.class",cascade=CascadeType.ALL)	
  C c;
   @ManyToOne(targetEntity="D.class",cascade=CascadeType.ALL)	
  D d;
}

out of 3 references I would be setting b and c and leave d as null. 
When I persist Object of A with b and c also as new instances the behaviour
of persist is inconsistent.

I have put postload methods in each of the B,C classes and printing the
auto-gererated hexadecimal UID. Every time the values of UID gets printed
but i dont see the corresponding query of insert into either B or C. 
If inserts are fired for B and C then the transaction is properly complete.

I am unable to see any error in the log generated other than the insert
failure thrown by db due to foreign key violation( Though it doesnt insert
either b or c it would try to insert A which would fail).

Any thoughts of where could be the problem would be of great help.

regards,
Srinivas KLP
-- 
View this message in context: http://n2.nabble.com/Incosistent-Persist-Operation-tp576518p576518.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message