Skip to content

Commit cd7f3a6

Browse files
authored
Merge pull request #6919 from kenjis/fix-docs-transactions
docs: fix transactions.rst
2 parents 1873121 + e6a4c08 commit cd7f3a6

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

user_guide_src/source/database/transactions.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ Running Transactions
3636
====================
3737

3838
To run your queries using transactions you will use the
39-
``$this->db->transStart()`` and ``$this->db->transComplete()`` functions as
39+
``$this->db->transStart()`` and ``$this->db->transComplete()`` methods as
4040
follows:
4141

4242
.. literalinclude:: transactions/001.php
4343

44-
You can run as many queries as you want between the start/complete
45-
functions and they will all be committed or rolled back based on the success
44+
You can run as many queries as you want between the ``transStart()``/``transComplete()``
45+
methods and they will all be committed or rolled back based on the success
4646
or failure of any given query.
4747

4848
Strict Mode
4949
===========
5050

5151
By default, CodeIgniter runs all transactions in Strict Mode. When strict
5252
mode is enabled, if you are running multiple groups of transactions, if
53-
one group fails all groups will be rolled back. If strict mode is
53+
one group fails all subsequent groups will be rolled back. If strict mode is
5454
disabled, each group is treated independently, meaning a failure of one
5555
group will not affect any others.
5656

@@ -61,9 +61,11 @@ Strict Mode can be disabled as follows:
6161
Managing Errors
6262
===============
6363

64-
If you have error reporting enabled in your Config/Database.php file
65-
you'll see a standard error message if the commit was unsuccessful. If
66-
debugging is turned off, you can manage your own errors like this:
64+
When you have ``DBDebug`` true in your **app/Config/Database.php** file,
65+
if a query error occurs, all the queries will be rolled backed, and an exception
66+
will be thrown. So you'll see a standard error page.
67+
68+
If the ``DBDebug`` is false, you can manage your own errors like this:
6769

6870
.. literalinclude:: transactions/003.php
6971

@@ -84,14 +86,15 @@ Test Mode
8486
You can optionally put the transaction system into "test mode", which
8587
will cause your queries to be rolled back -- even if the queries produce
8688
a valid result. To use test mode simply set the first parameter in the
87-
``$this->db->transStart()`` function to true:
89+
``$this->db->transStart()`` method to true:
8890

8991
.. literalinclude:: transactions/005.php
9092

9193
Running Transactions Manually
9294
=============================
9395

94-
If you would like to run transactions manually you can do so as follows:
96+
When you have ``DBDebug`` false in your **app/Config/Database.php** file, and
97+
if you would like to run transactions manually you can do so as follows:
9598

9699
.. literalinclude:: transactions/006.php
97100

0 commit comments

Comments
 (0)