| 接口 | 说明 |
|---|---|
| TxFun |
支持定制事务行为,否则 Tx 拦截器只会在抛出异常时回滚事务
例如通过返回值 Ret 对象来决定事务的提交与回滚:
Tx.setTxFun((inv, conn) -> {
inv.invoke();
// 根据业务层返回值 Ret 对象的状态决定提交与回滚
Object retValue = inv.getReturnValue();
if (retValue instanceof Ret) {
Ret ret = (Ret)retValue;
if (ret.isOk()) {
conn.commit();
} else {
conn.rollback();
}
return ;
}
// 返回其它类型值的情况
conn.commit();
});
|
| 类 | 说明 |
|---|---|
| Transaction |
ActiveRecord declare transaction.
|
| Tx |
ActiveRecord declare transaction.
|
| TxByMethodRegex |
TxByMethodRegex.
|
| TxByMethods |
TxByMethods
|
| TxReadCommitted |
TxReadCommitted.
|
| TxReadUncommitted |
TxReadUncommitted.
|
| TxRepeatableRead |
TxRepeatableRead.
|
| TxSerializable |
TxSerializable.
|
| 注释类型 | 说明 |
|---|---|
| TxConfig |
TxConfig is used to configure configName for Tx interceptor
|
Copyright © 2024. All rights reserved.