From c572dd795b7b84bc983dcca646c1ba4ff5f7fa98 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 12 Apr 2024 11:47:51 +0900 Subject: [PATCH] docs: add "Resetting Transaction Status" --- user_guide_src/source/database/transactions.rst | 17 ++++++++++++++++- .../source/database/transactions/009.php | 3 +++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 user_guide_src/source/database/transactions/009.php diff --git a/user_guide_src/source/database/transactions.rst b/user_guide_src/source/database/transactions.rst index 5d01d883a5d5..5c48f2806240 100644 --- a/user_guide_src/source/database/transactions.rst +++ b/user_guide_src/source/database/transactions.rst @@ -14,7 +14,7 @@ transactions. .. contents:: :local: - :depth: 2 + :depth: 3 CodeIgniter's Approach to Transactions ====================================== @@ -64,6 +64,21 @@ Strict Mode can be disabled as follows: .. literalinclude:: transactions/002.php +.. _transactions-resetting-transaction-status: + +Resetting Transaction Status +---------------------------- + +.. versionadded:: 4.6.0 + +When strict mode is enabled, if one transaction fails, all subsequent transactions +will be rolled back. + +If you wan to restart transactions after a failure, you can reset the transaction +status: + +.. literalinclude:: transactions/009.php + .. _transactions-managing-errors: Managing Errors diff --git a/user_guide_src/source/database/transactions/009.php b/user_guide_src/source/database/transactions/009.php new file mode 100644 index 000000000000..6b92adf1793f --- /dev/null +++ b/user_guide_src/source/database/transactions/009.php @@ -0,0 +1,3 @@ +db->resetTransStatus();