MySQL Variables session_track_transaction_info 数据库 参数变量解释及正确配置使用
本站中文解释
session_track_transaction_info 是一个 MySQL 参数变量,它用来控制是否启用收集和客户端会话之间的事务信息,并通过信息系统来把这些信息发送到客户端,以确保客户端可以对他们作出正确的响应。此变量只在服务器启动时有效,建议使用超级管理员权限设置此变量值(0或1),可以使用以下的命令行或SQL查询来设置此变量:
— 使用命令行来设置session_track_transaction_info
mysql> SET GLOBAL session_track_transaction_info=1;
— 使用SQL查询来设置session_track_transaction_info
mysql> SET GLOBAL session_track_transaction_info=1;
官方英文解释
session_track_transaction_info
Command-Line Format | --session-track-transaction-info=value |
---|---|
System Variable | session_track_transaction_info |
Scope | Global, Session |
Dynamic | Yes |
Type | Enumeration |
Default Value | OFF |
Valid Values |
|
Controls whether the server tracks the state and
characteristics of transactions within the current session and
notifies the client to make this information available. These
session_track_transaction_info
values are permitted:
-
OFF
: Disable transaction state
tracking. This is the default. -
STATE
: Enable transaction state
tracking without characteristics tracking. State tracking
enables the client to determine whether a transaction is
in progress and whether it could be moved to a different
session without being rolled back. -
CHARACTERISTICS
: Enable transaction
state tracking, including characteristics tracking.
Characteristics tracking enables the client to determine
how to restart a transaction in another session so that it
has the same characteristics as in the original session.
The following characteristics are relevant for this
purpose:ISOLATION LEVEL READ ONLY READ WRITE WITH CONSISTENT SNAPSHOT
For a client to safely relocate a transaction to another
session, it must track not only transaction state but also
transaction characteristics. In addition, the client must
track the
transaction_isolation
and
transaction_read_only
system
variables to correctly determine the session defaults. (To
track these variables, list them in the value of the
session_track_system_variables
system variable.)
For more information about session state tracking, see
Section 5.1.15, “Server Tracking of Client Session State”.