public class SagaClientContext extends SagaContext
SagaClientConfiggid, nested, sagaContextFactory, time| 构造器和说明 |
|---|
SagaClientContext(SagaClientConfig config) |
| 限定符和类型 | 方法和说明 |
|---|---|
<T> T |
callService(Callable<T> callable,
Runnable runnable)
非sql类的,比如批量增加数据,逆向操作可能只是简单的删除外键,而不需要每条都删除
|
protected void |
clear() |
void |
commit() |
SagaTransaction |
getTransaction() |
boolean |
realRollback()
真正的本地回滚
|
void |
rollback() |
void |
start() |
void |
start(String gid) |
static SagaClientContext |
tempContext(SagaClientTransaction transaction,
SagaClientConfig config)
创建一个临时
|
setGid, setTimepublic SagaClientContext(SagaClientConfig config)
public static SagaClientContext tempContext(SagaClientTransaction transaction, SagaClientConfig config)
transaction - config - public void start()
start 在类中 SagaContextpublic void start(String gid)
start 在类中 SagaContextpublic void commit()
commit 在类中 SagaContextpublic void rollback()
rollback 在类中 SagaContextpublic boolean realRollback()
public SagaTransaction getTransaction()
getTransaction 在类中 SagaContextprotected void clear()
public <T> T callService(Callable<T> callable, Runnable runnable) throws Exception
callService 在类中 SagaContextT - callable - runnable - ,必须保证callable和runnable可被json序列化和反序列化ExceptionCopyright © 2021. All rights reserved.