mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-11 01:36:07 +00:00
#1730 - Fix for wrong JDBC batch sorting / ordering
This is a bit of a refactor that simplifies the ordering of batch execution (BatchedBeanHolder ordering). In short we batch by bean type and depth (rather than just type). This means that there are some cases we are not optimal (where we could batch by bean type in different depths) but that is expected to be rare and problematic for hierarchies of the same type.
This commit is contained in:
1 parent
73ab2ee1fe
commit
7e768623e4
7 files changed
+126
-136
No files matched your search
@@ -38,7 +38,7 @@ public class TestInsertBatchThenFlushThenUpdate extends BaseTestCase {
|
||||
Ebean.save(parent);
|
||||
|
||||
// nothing flushed yet
|
||||
assertEquals(0, LoggedSqlCollector.start().size());
|
||||
assertThat(LoggedSqlCollector.start()).isEmpty();
|
||||
|
||||
txn.flushBatch();
|
||||
|
||||
@@ -49,14 +49,14 @@ public class TestInsertBatchThenFlushThenUpdate extends BaseTestCase {
|
||||
Ebean.save(parent);
|
||||
|
||||
// nothing flushed yet
|
||||
assertEquals(0, LoggedSqlCollector.start().size());
|
||||
assertThat(LoggedSqlCollector.start()).isEmpty();
|
||||
|
||||
Ebean.commitTransaction();
|
||||
|
||||
// insert statements for EdExtendedParent
|
||||
List<String> loggedSql2 = LoggedSqlCollector.start();
|
||||
assertEquals(2, loggedSql2.size());
|
||||
assertTrue(loggedSql2.get(0).contains(" update td_parent "));
|
||||
assertThat(loggedSql2).hasSize(2);
|
||||
assertThat(loggedSql2.get(0)).contains(" update td_parent ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user