Description\n-----------\n\nMariaDB has always had the wait_timeout and interactive_timeout settings, which close connections after a certain period of inactivity.\n\nHowever, these are by default set to a long wait period. In situations where transactions may be started, but not committed or rolled back, more granular control and a shorter timeout may be desirable so as to avoid locks being held for too long.\n\nThese variables help handle this situation:\n\n idle_transaction_timeout (all transactions)\n idle_write_transaction_timeout (write transactions)\n idle_readonly_transaction_timeout (read transactions)\n\nThere is no variables for more granular control.\n\nThese accept a time in seconds to time out, by closing the connection, transactions that are idle for longer than this period. By default all are set to zero, or no timeout.\n\nidle_transaction_timeout affects all transactions, idle_write_transaction_timeout affects write transactions only and idle_readonly_transaction_timeout affects read transactions only. The latter two variables work independently. However, if either is set along with idle_transaction_timeout, the settings for idle_write_transaction_timeout or idle_readonly_transaction_timeout will take precedence.\n\nExamples\n--------\n\nSET SESSION idle_transaction_timeout=2;\nBEGIN;\nSELECT  FROM t;\nEmpty set (0.000 sec)\nwait 3 seconds\nSELECT * FROM t;\nERROR 2006 (HY000): MySQL server has gone away\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/transactions/transaction-timeouts