#2138 - Mark Transaction.flushBatch() as deprecated - migrate to flush();

This commit is contained in:
rob bygrave
2020-12-21 14:58:04 +13:00
parent f22a322104
commit 400ae3cf4b
7 changed files with 17 additions and 17 deletions
@@ -24,7 +24,7 @@ public class TestInsertDuplicateKey extends BaseTestCase {
public void clearDb() {
server().find(Document.class).asDraft().where().contains("title", "UniqueKey").delete();
}
@Test(expected = DuplicateKeyException.class)
public void insert_duplicateKey() {
@@ -89,7 +89,7 @@ public class TestInsertDuplicateKey extends BaseTestCase {
doc2.save();
// flush at this point, fails
Ebean.getDefaultServer().currentTransaction().flushBatch();
Ebean.getDefaultServer().currentTransaction().flush();
} catch (DuplicateKeyException e) {
log.info("duplicate failed but just continue" + e.getMessage());
try {
@@ -40,7 +40,7 @@ public class TestInsertBatchThenFlushThenUpdate extends BaseTestCase {
// nothing flushed yet
assertThat(LoggedSqlCollector.start()).isEmpty();
txn.flushBatch();
txn.flush();
List<String> loggedSql1 = LoggedSqlCollector.start();
assertThat(loggedSql1).hasSize(4);
@@ -11,7 +11,7 @@ import org.tests.model.basic.ESimple;
/**
* This test tests a strange bug in the 6.2.0. sqlserver JDBC driver.
* (Version 6.1.7.jre8-preview works)
*
* <p>
* https://github.com/Microsoft/mssql-jdbc/pull/374
*
* @author Roland Praml, FOCONIS AG
@@ -29,7 +29,7 @@ public class TestSqlServerBatch extends BaseTestCase {
for (int i = 0; i < 10; i++) {
ESimple model = new ESimple();
model.setName("baz "+i);
model.setName("baz " + i);
Ebean.save(model);
}
@@ -56,13 +56,13 @@ public class TestSqlServerBatch extends BaseTestCase {
txn.setGetGeneratedKeys(false);
// explicitly flush the JDBC batch buffer
txn.flushBatch();
txn.flush();
for (int i = 0; i < 10; i++) {
ESimple model = new ESimple();
model.setName(i % 2 == 0 ? null:"foobar");
Ebean.save(model);
}
for (int i = 0; i < 10; i++) {
ESimple model = new ESimple();
model.setName(i % 2 == 0 ? null : "foobar");
Ebean.save(model);
}
// do not commit
} finally {