apache / apache/incubator-seata

seata TM端 TransactionHook 增加上下文参数,支持更好的个性化扩展

Open
#4,823 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
26k
Forks
8.8k
Avg merge
1d 8h
Merged PRs (30d)
4

Description

## Why you need it?
使用这在进行tm端全局事务扩展的时候,希望能在TransactionHook中的 afterCommit 获取当前事务开启的GlobalTransaction 中获取全局事务提交时的状态,也就是调用getLocalStatus()方法获取本地状态。用于判断提交的处理结果。可以考虑把
TransactionInfo txInfo, GlobalTransaction tx这两个参数都传递到 Hook的方法中,用于个性化处理。

## How it could be?
用beginTransaction 举例:
在TransactionalTemplate 类中,可以在 把beginTransaction 方法中 triggerBeforeBegin()方法增加TransactionInfo txInfo, GlobalTransaction tx两个入参,同时对于TransactionHook 的方法补充对应的入参。
## Other related information
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

Research direction

Start in TransactionalTemplate.beginTransaction and trace the TransactionHook triggerBeforeBegin and afterCommit call sites. Read the surrounding TransactionInfo and GlobalTransaction usage to understand the existing lifecycle, then verify that hook implementations and callers remain consistent and that afterCommit can inspect the transaction's local status.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.