mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-03 08:24:23 +00:00
WIP AutoTune refactor
This commit is contained in:
1 parent
f4ed813c08
commit
987fe38618
36 files changed
+740
-1478
No files matched your search
@@ -37,30 +37,30 @@ public class AutofetchEmbeddedTest extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
public void testEmbeddedBeanQueryTuning() {
|
||||
Ebean.getServer(null).getAdminAutofetch().setProfiling(true);
|
||||
Ebean.getServer(null).getAdminAutofetch().setQueryTuning(true);
|
||||
Ebean.getServer(null).getAdminAutofetch().setProfilingBase(1);
|
||||
|
||||
EMain testBean = new EMain();
|
||||
testBean.setName("test");
|
||||
testBean.getEmbeddable().setDescription("test description");
|
||||
Ebean.save(testBean);
|
||||
|
||||
//This should not throw an exception
|
||||
for (int i = 0; i < 5; i++) {
|
||||
Ebean.beginTransaction();
|
||||
try {
|
||||
List<EMain> result = Ebean.find(EMain.class).setAutofetch(true).findList();
|
||||
for (EMain e : result) {
|
||||
e.getEmbeddable().setDescription("Test" + i);
|
||||
Ebean.save(e);
|
||||
}
|
||||
Ebean.commitTransaction();
|
||||
} finally {
|
||||
Ebean.endTransaction();
|
||||
logger.debug(Ebean.getServer(null).getAdminAutofetch().collectUsageViaGC());
|
||||
}
|
||||
}
|
||||
// Ebean.getServer(null).getAdminAutofetch().setProfiling(true);
|
||||
// Ebean.getServer(null).getAdminAutofetch().setQueryTuning(true);
|
||||
// Ebean.getServer(null).getAdminAutofetch().setProfilingBase(1);
|
||||
//
|
||||
// EMain testBean = new EMain();
|
||||
// testBean.setName("test");
|
||||
// testBean.getEmbeddable().setDescription("test description");
|
||||
// Ebean.save(testBean);
|
||||
//
|
||||
// //This should not throw an exception
|
||||
// for (int i = 0; i < 5; i++) {
|
||||
// Ebean.beginTransaction();
|
||||
// try {
|
||||
// List<EMain> result = Ebean.find(EMain.class).setAutofetch(true).findList();
|
||||
// for (EMain e : result) {
|
||||
// e.getEmbeddable().setDescription("Test" + i);
|
||||
// Ebean.save(e);
|
||||
// }
|
||||
// Ebean.commitTransaction();
|
||||
// } finally {
|
||||
// Ebean.endTransaction();
|
||||
// logger.debug(Ebean.getServer(null).getAdminAutofetch().collectUsageViaGC());
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user