Skip to content

Commit 821913c

Browse files
committed
docs: add about DB transactions in changelog
1 parent 58cfbd1 commit 821913c

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

user_guide_src/source/changelogs/v4.3.0.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,22 @@ Exceptions when Database Errors Occur
2727

2828
- The exceptions thrown by the database connection classes have been changed to ``CodeIgniter\Database\Exceptions\DatabaseException``. Previously, different database drivers threw different exception classes, but these have been unified into ``DatabaseException``.
2929
- The exceptions thrown by the ``execute()`` method of Prepared Queries have been changed to ``DatabaseException``. Previously, different database drivers might throw different exception classes or did not throw exceptions, but these have been unified into ``DatabaseException``.
30-
- ``DBDebug`` and ``CI_DEBUG``
30+
- ``DBDebug`` and ``CI_DEBUG`` Changes
3131

3232
- To be consistent in behavior regardless of environments, ``Config\Database::$default['DBDebug']``
3333
and ``Config\Database::$tests['DBDebug']`` has been changed to ``true`` by default. With these
34-
settings, an exception is always thrown when a database error occurs.
34+
settings, an exception is always thrown when a database error occurs. Previously, it is ``false``
35+
**only in the production environment**.
3536
- Now ``DatabaseException`` thrown in ``BaseBuilder`` is thrown if ``$DBDebug`` is true.
3637
Previously, it is thrown if ``CI_DEBUG`` is true.
3738
- The default value of ``BaseConnection::$DBDebug`` has been changed to ``true``.
3839
- With these changes, ``DBDebug`` **now means whether or not to throw an exception when an error occurs**.
3940
Although unrelated to debugging, the name has not been changed.
41+
- When running transactions with ``DBDebug`` is ``true``, if a query error occurs, all the queries
42+
will be rolled backed, and an exception will be thrown. :ref:`transactions-managing-errors` or
43+
:ref:`transactions-manual-transactions` won't work. This is no different from previous versions,
44+
but changing the ``DBDebug`` setting from the previous default value to ``true`` will change the
45+
behavior in the production environment.
4046
- Now when you delete without WHERE clause in ``Model``, ``DatabaseException`` is thrown even if
4147
``CI_DEBUG`` is false. Previously, it is thrown if ``CI_DEBUG`` is true.
4248

user_guide_src/source/database/transactions.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ Strict Mode can be disabled as follows:
7272
and different database drivers might throw different exception classes
7373
or did not throw exceptions.
7474

75+
.. _transactions-managing-errors:
76+
7577
Managing Errors
7678
===============
7779

@@ -111,6 +113,8 @@ a valid result. To use test mode simply set the first parameter in the
111113

112114
.. literalinclude:: transactions/005.php
113115

116+
.. _transactions-manual-transactions:
117+
114118
Running Transactions Manually
115119
=============================
116120

0 commit comments

Comments
 (0)