Skip to content

Commit

Permalink
docs: add "Resetting Transaction Status"
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Apr 12, 2024
1 parent c121e78 commit 4c1ecf1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 16 additions & 1 deletion user_guide_src/source/database/transactions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ transactions.

.. contents::
:local:
:depth: 2
:depth: 3

CodeIgniter's Approach to Transactions
======================================
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions user_guide_src/source/database/transactions/009.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

$this->db->resetTransStatus();

0 comments on commit 4c1ecf1

Please sign in to comment.