openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "roger.keays" <roger.ke...@ninthavenue.com.au>
Subject ON DELETE CASCADE causes OptimisticLockingException
Date Thu, 13 Dec 2007 02:08:17 GMT

Hey,

Since upgrading to 1.0.0, all my CASCADE DELETE foreign key actions cause an
OptimisticLockingException when you delete the owning entity. This happens
even if @ForeignKey describes the delete action correctly.

e.g

@Entity A {
  @OneToMany(cascade=CascadeType.ALL, mappedBy="a")
  List b;
}

@Entity B {
  @ForeignKey(deleteAction=ForeignKeyAction.CASCADE)
  @ManyToOne(cascade=CascadeType.MERGE)
  A a;
}

If I delete A when there is a cascading foreign key the exception is thrown.
Without the key, there is no exception.

Roger
-- 
View this message in context: http://www.nabble.com/ON-DELETE-CASCADE-causes-OptimisticLockingException-tp14308483p14308483.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message