-3

As far as I know, TiDB does not support session timeout on the database level. But can I use the session ID to implement session timeout in TiDB on the application level? What should I do?

Coco
  • 29
  • 4

2 Answers2

0

It is true that TiDB does not support session timeout in the database level currently.

If you want to implement session timeout on the application level, use the session ID started by side records in the absence of LB (Load Balancing), and customize the session timeout on the application. After timeout, kill SQL using kill tidb [session id] on the node that starts the query.

It is currently recommended to implement session timeout using applications. When the timeout time is reached, the application layer reports an exception and continues to execute subsequent program segments.

Lilian Lee
  • 190
  • 1
  • 12
0

Actually it was supported in TiDB since release 3.0. Search wait_timeout in https://pingcap.com/docs/stable/releases/3.0beta/#tidb for more details.

Jack Yu
  • 11
  • 2