八、单机事务
public void tx(Runnable runnable) {}
public <T> T tx(Supplier<T> supplier) {}
public <T> T tx(Boolean readOnly, Supplier<T> supplier) {}
public void tx(Boolean readOnly, Runnable runnable) {}
public void tx(TxIsolationEnum isolationEnum, Runnable runnable) {}
public <T> T tx(TxIsolationEnum isolationEnum, Supplier<T> supplier) {}
public void tx(TxIsolationEnum isolationEnum, Boolean readOnly, Runnable runnable) {}
public <T> T tx(TxIsolationEnum isolationEnum, Boolean readOnly, Supplier<T> supplier){}1.事务只读
/**
* 只读事务
*/
@Test
public void test5(){
AtomicReference<List<String>> groupList = new AtomicReference<>();
AtomicReference<List<String>> nameList = new AtomicReference<>();
neo.tx(true, ()->{
groupList.set(neo.values(TABLE_NAME, "group"));
nameList.set(neo.values(TABLE_NAME, "name"));
});
// [12, group555]
show(groupList);
// [name333]
show(nameList);
}2.事务隔离
Last updated