mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#568 - ENH: Add ability to turn of getGeneratedKeys with @Transactional annotation (Also needs agent update)
This commit is contained in:
@@ -15,7 +15,7 @@ public class BaseTestCase {
|
||||
logger.debug("... preStart");
|
||||
if (!AgentLoader.loadAgentFromClasspath("avaje-ebeanorm-agent","debug=0;packages=com.avaje.tests.**,org.avaje.test.**")) {
|
||||
logger.info("avaje-ebeanorm-agent not found in classpath - not dynamically loaded");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,6 +13,9 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
//import static org.assertj.core.api.Assertions.assertThat;
|
||||
//import static org.junit.Assert.assertNull;
|
||||
|
||||
public class TestBatchInsertSimple extends BaseTestCase {
|
||||
|
||||
Random random = new Random();
|
||||
@@ -63,6 +66,35 @@ public class TestBatchInsertSimple extends BaseTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
// @Test
|
||||
// public void testTransactional_skipGeneratedBeans() {
|
||||
//
|
||||
// if (isMsSqlServer()) return;
|
||||
//
|
||||
// List<UTMaster> beans = saveWithFullBatchMode_skipGeneratedKeys();
|
||||
// for (UTMaster bean : beans) {
|
||||
// assertNull(bean.getId());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Transactional(batch=PersistBatch.ALL, batchSize=50, getGeneratedKeys = false)
|
||||
// public List<UTMaster> saveWithFullBatchMode_skipGeneratedKeys() {
|
||||
//
|
||||
// Transaction transaction = server().currentTransaction();
|
||||
// SpiTransaction spiTxn = (SpiTransaction)transaction;
|
||||
// Boolean generatedKeys = spiTxn.getBatchGetGeneratedKeys();
|
||||
//
|
||||
// assertThat(generatedKeys).isFalse();
|
||||
//
|
||||
// List<UTMaster> beans = new ArrayList<UTMaster>();
|
||||
// for (int i = 0; i < 4; i++) {
|
||||
// beans.add(createMaster(i));
|
||||
// }
|
||||
//
|
||||
// server().saveAll(beans);
|
||||
// return beans;
|
||||
// }
|
||||
|
||||
@Test
|
||||
public void testJdbcBatchPerRequestWithMasterOnly() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user