#450 - @ManyToMany with cascade and jdbc batch - ensure flush occurs

This commit is contained in:
Robin Bygrave
2015-11-03 16:31:27 +13:00
parent 11f4c8d7a3
commit 511ebd8a29
@@ -918,6 +918,10 @@ public final class DefaultPersister implements Persister {
t.depth(+1);
if (additions != null && !additions.isEmpty()) {
// ensure any cascade batch has been flushed prior
// to inserting into the intersection table
t.flushBatch();
for (Object other : additions) {
EntityBean otherBean = (EntityBean) other;
// the object from the 'other' side of the ManyToMany
@@ -943,6 +947,10 @@ public final class DefaultPersister implements Persister {
}
}
if (deletions != null && !deletions.isEmpty()) {
// ensure any cascade batch has been flushed prior
// to inserting into the intersection table
t.flushBatch();
for (Object other : deletions) {
EntityBean otherDelete = (EntityBean) other;
// the object from the 'other' side of the ManyToMany