mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1197 - Refactor how @Transactional methods internally managed
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package io.ebeaninternal.api;
|
||||
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.TxScope;
|
||||
import org.junit.Test;
|
||||
import org.tests.model.basic.Contact;
|
||||
import org.tests.model.basic.Customer;
|
||||
import org.tests.model.basic.ResetBasicData;
|
||||
import org.tests.model.basic.UUOne;
|
||||
|
||||
public class HelpScopeTransTest {
|
||||
|
||||
@Test
|
||||
public void begin() throws Exception {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
HelpScopeTrans.enter(TxScope.required());
|
||||
HelpScopeTrans.enter(TxScope.required());
|
||||
|
||||
Ebean.find(Customer.class).findList();
|
||||
|
||||
HelpScopeTrans.enter(TxScope.required());
|
||||
Ebean.find(Contact.class).findList();
|
||||
|
||||
HelpScopeTrans.exit(null, 1);
|
||||
|
||||
UUOne one = new UUOne();
|
||||
one.setName("junk");
|
||||
Ebean.save(one);
|
||||
|
||||
HelpScopeTrans.exit(null, 1);
|
||||
HelpScopeTrans.exit(null, 1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -53,6 +53,16 @@ public class TDSpiEbeanServer implements SpiEbeanServer {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scopedTransactionEnter(TxScope txScope) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scopedTransactionExit(Object returnOrThrowable, int opCode) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object currentTenantId() {
|
||||
return null;
|
||||
@@ -163,11 +173,6 @@ public class TDSpiEbeanServer implements SpiEbeanServer {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScopeTrans createScopeTrans(TxScope txScope) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpiTransaction createQueryTransaction(Object tenantId) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user