You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2019/07/27 11:30:41 UTC

[servicecomb-pack] 03/05: SCB-1391 Write docs for TCC explicit transaction passing

This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-pack.git

commit e0974254a8b91af9bf6ed67e3f762182e1347f0b
Author: Daniel Qian <ch...@gmail.com>
AuthorDate: Wed Jul 24 20:34:25 2019 +0800

    SCB-1391 Write docs for TCC explicit transaction passing
---
 docs/user_guide.md    | 6 +++++-
 docs/user_guide_zh.md | 4 +++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/docs/user_guide.md b/docs/user_guide.md
index cc40e87..6963a9a 100644
--- a/docs/user_guide.md
+++ b/docs/user_guide.md
@@ -111,7 +111,7 @@ Take a transfer money application as an example:
 
 5. Since pack-0.3.0,  you can access the [OmegaContext](https://github.com/apache/servicecomb-pack/blob/master/omega/omega-context/src/main/java/org/apache/servicecomb/pack/omega/context/OmegaContext.java) for the gloableTxId and localTxId in the @Compensable annotated method or the cancel method.
 
-#### Passing transaction context explicitly
+#### <a name="explicit-tx-context-passing"></a>Passing transaction context explicitly
 
 In most cases, Omega passing the transaction context for you transparently (see [Inter-Service Communication](design.md#comm) for details). Transaction context passing is implemented in a way of injecting transaction context information on the sender side and extracting it on the receiver side. Below is an example to illustrate this process:
 
@@ -265,6 +265,10 @@ Add TCC annotations and corresponding confirm and cancel methods
 
  4. Repeat step 2 for the `transferIn` service.
 
+#### Passing transaction context explicitly
+
+Just like Saga's `@Compensable`,`@Participate` also supports explicit transaction passing. Please refer to [Saga - Passing transaction context explicitly](#explicit-tx-context-passing) for more details.
+
 
 ## How to run
 1. run postgreSQL.
diff --git a/docs/user_guide_zh.md b/docs/user_guide_zh.md
index 52b1bea..93ff475 100644
--- a/docs/user_guide_zh.md
+++ b/docs/user_guide_zh.md
@@ -111,7 +111,7 @@ Saga可通过以下任一方式进行构建:
 
 5. 从pack-0.3.0开始, 你可以在服务函数或者取消函数中通过访问 [OmegaContext](https://github.com/apache/servicecomb-pack/blob/master/omega/omega-context/src/main/java/org/apache/servicecomb/pack/omega/context/OmegaContext.java) 来获取 gloableTxId 以及 localTxId 信息。
 
-#### 显式传递事务上下文
+#### <a name="explicit-tx-context-passing"></a>显式传递事务上下文
 
 在一般情况下,Omega能够替你处理事务上下文的传递工作(详情见[服务间通信流程](design_zh.md#comm)),因此你的代码并不需要知道事务上下文的存在。而事务上下文的传递实际上是通过在请求方注入、在接受方提取来完成的,下面举一个请例子来说明这个过程:
 
@@ -265,7 +265,9 @@ public void bar(BarCommandWithTxContext cmdWithTxContext) {
 
 5. 从pack-0.3.0开始, 你可以在服务函数或者取消函数中通过访问 [OmegaContext](https://github.com/apache/servicecomb-pack/blob/master/omega/omega-context/src/main/java/org/apache/servicecomb/pack/omega/context/OmegaContext.java) 来获取 gloableTxId 以及 localTxId 信息。
 
+#### 显式传递事务上下文
 
+与Saga的`@Compensable`一样,TCC的`@Participate`也支持[显式传递事务上下文](#explicit-tx-context-passing),详情可参阅Saga章节。
 
 
 ## 如何运行