mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Merge branch 'issue/1263-transaction-api'
This commit is contained in:
@@ -32,13 +32,13 @@ public class TestBatchInsertFlush extends BaseTestCase {
|
||||
MetaInfoManager metaInfoManager = server.getMetaInfoManager();
|
||||
metaInfoManager.collectTransactionStatistics(true);
|
||||
|
||||
Transaction transaction = server.beginTransaction();
|
||||
try {
|
||||
transaction.setPersistCascade(false);
|
||||
transaction.setBatchSize(10);
|
||||
transaction.setBatch(PersistBatch.ALL);
|
||||
transaction.setLabel("TestBatchInsertFlush.no_cascade");
|
||||
Transaction transaction = server.beginTransaction()
|
||||
.setPersistCascade(false)
|
||||
.setBatchSize(10)
|
||||
.setBatch(PersistBatch.ALL)
|
||||
.setLabel("TestBatchInsertFlush.no_cascade");
|
||||
|
||||
try {
|
||||
|
||||
LoggedSqlCollector.start();
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@ package org.tests.batchinsert;
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.annotation.Transactional;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import io.ebean.annotation.Transactional;
|
||||
import org.junit.Test;
|
||||
import org.tests.model.basic.UTDetail;
|
||||
import org.tests.model.basic.UTMaster;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -128,11 +128,12 @@ public class TestBatchInsertSimple extends BaseTestCase {
|
||||
masters.add(createMasterAndDetails(i, 7));
|
||||
}
|
||||
|
||||
Transaction transaction = Ebean.beginTransaction();
|
||||
Transaction transaction = Ebean.beginTransaction()
|
||||
.setBatch(PersistBatch.NONE)
|
||||
.setBatchOnCascade(PersistBatch.ALL)
|
||||
.setBatchSize(20);
|
||||
|
||||
try {
|
||||
transaction.setBatch(PersistBatch.NONE);
|
||||
transaction.setBatchOnCascade(PersistBatch.ALL);
|
||||
transaction.setBatchSize(20);
|
||||
|
||||
// escalate based on batchOnCascade value
|
||||
Ebean.saveAll(masters);
|
||||
|
||||
@@ -22,10 +22,8 @@ public class TestSqlServerBatch extends BaseTestCase {
|
||||
@Test
|
||||
public void testBasicIdentityBatch() {
|
||||
|
||||
Transaction txn = Ebean.beginTransaction();
|
||||
Transaction txn = Ebean.beginTransaction().setBatchMode(true).setBatchSize(3);
|
||||
try {
|
||||
txn.setBatchMode(true);
|
||||
txn.setBatchSize(3);
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
ESimple model = new ESimple();
|
||||
|
||||
Reference in New Issue
Block a user