You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: user_guide_src/source/changelogs/v4.3.0.rst
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,16 +27,22 @@ Exceptions when Database Errors Occur
27
27
28
28
- 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``.
29
29
- 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
31
31
32
32
- To be consistent in behavior regardless of environments, ``Config\Database::$default['DBDebug']``
33
33
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**.
35
36
- Now ``DatabaseException`` thrown in ``BaseBuilder`` is thrown if ``$DBDebug`` is true.
36
37
Previously, it is thrown if ``CI_DEBUG`` is true.
37
38
- The default value of ``BaseConnection::$DBDebug`` has been changed to ``true``.
38
39
- With these changes, ``DBDebug`` **now means whether or not to throw an exception when an error occurs**.
39
40
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.
40
46
- Now when you delete without WHERE clause in ``Model``, ``DatabaseException`` is thrown even if
41
47
``CI_DEBUG`` is false. Previously, it is thrown if ``CI_DEBUG`` is true.
0 commit comments