---
title: SetTransactionId
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/others/dataflowdevg/udfrefc_23_00057.html
sourcePath: /source/zh/canncommercial/900/others/dataflowdevg/udfrefc_23_00057.html
indexId: 65251103c07598292fef33cdffe1394a1b67b182c3ed94db3b30bb1d36c4398f71
---
# SetTransactionId

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | x |
| Atlas 推理系列产品 | x |
| Atlas 训练系列产品 | x |


#### 函数功能

设置FlowMsg消息中的事务ID，事务ID从1开始计数，可用于识别哪一批数据，设置为0时表示不使用自定义的transaction_id，内部会采用自增的方式自动生成transaction_id。


#### 函数原型

```
virtual void SetTransactionId(uint64_t transactionId)
```


#### 参数说明

| 参数名 | 输入/输出 | 描述 |
| --- | --- | --- |
| transactionId | 输入 | 消息的事务ID |


#### 返回值

无。


#### 异常处理

无。


#### 约束说明

无。
