mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-25 15:18:59 +00:00
#1240 - ENH: Add support for @Transactional skipCache and label
This commit is contained in:
1 parent
9a0b742f14
commit
07e2605a30
4 files changed
+24
-7
No files matched your search
@@ -3,12 +3,16 @@ package org.tests.transaction;
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.annotation.TxType;
|
||||
import io.ebean.annotation.Transactional;
|
||||
import io.ebean.annotation.TxType;
|
||||
import io.ebean.meta.MetaInfoManager;
|
||||
import io.ebean.meta.MetaTimedMetric;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class TestNestedMandatory extends BaseTestCase {
|
||||
@@ -20,12 +24,24 @@ public class TestNestedMandatory extends BaseTestCase {
|
||||
@Test
|
||||
public void test() {
|
||||
|
||||
MetaInfoManager metaInfoManager = Ebean.getDefaultServer().getMetaInfoManager();
|
||||
metaInfoManager.collectTransactionStatistics(true);
|
||||
|
||||
new Outer().doOuter();
|
||||
|
||||
List<MetaTimedMetric> txnMetrics = metaInfoManager.collectTransactionStatistics(true);
|
||||
for (MetaTimedMetric txnTimed : txnMetrics) {
|
||||
System.out.println(txnTimed);
|
||||
}
|
||||
|
||||
//Put these asserts back when agent is upgraded
|
||||
// assertThat(txnMetrics).hasSize(2);
|
||||
// assertThat(txnMetrics.get(1).getName()).isEqualTo("txn.named.outer");
|
||||
}
|
||||
|
||||
class Outer {
|
||||
|
||||
@Transactional
|
||||
@Transactional(label = "outer")
|
||||
void doOuter() {
|
||||
outerTxn = Ebean.currentTransaction();
|
||||
|
||||
|
||||
Reference in new issue
Block a user