Skip to content

Commit b7737be

Browse files
committed
docs(database): clarify lockForUpdate driver notes
Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
1 parent ab652c5 commit b7737be

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

system/Database/BaseBuilder.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,8 @@ class BaseBuilder
112112

113113
/**
114114
* QB FOR UPDATE flag
115-
*
116-
* @var bool
117115
*/
118-
protected $QBLockForUpdate = false;
116+
protected bool $QBLockForUpdate = false;
119117

120118
/**
121119
* QB ORDER BY data

user_guide_src/source/database/query_builder.rst

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -777,16 +777,18 @@ Use this method inside a database transaction. The exact locking behavior is
777777
determined by the database server and transaction isolation level.
778778

779779
This method is supported by the **MySQLi**, **Postgre**, **OCI8**, and
780-
**SQLSRV** drivers. Unsupported drivers throw a ``DatabaseException``.
781-
782-
SQLSRV uses SQL Server table hints instead of a trailing ``FOR UPDATE`` clause.
783-
The hint is applied to table references in the ``FROM`` clause; joined tables
784-
are not hinted. Its exact lock granularity depends on SQL Server's execution
785-
plan and transaction isolation level. SQLSRV does not support
786-
``lockForUpdate()`` without a ``FROM`` table or on subqueries.
787-
788-
OCI8 does not support ``lockForUpdate()`` together with ``limit()`` or
789-
``offset()`` because Oracle does not allow ``FOR UPDATE`` with row limiting.
780+
**SQLSRV** drivers. Unsupported drivers throw a ``DatabaseException``. See the
781+
following notes for OCI8 and SQLSRV driver-specific behavior.
782+
783+
.. note:: SQLSRV uses SQL Server table hints instead of a trailing ``FOR UPDATE``
784+
clause. The hint is applied to table references in the ``FROM`` clause;
785+
joined tables are not hinted. Its exact lock granularity depends on SQL
786+
Server's execution plan and transaction isolation level. SQLSRV does not
787+
support ``lockForUpdate()`` without a ``FROM`` table or on subqueries.
788+
789+
.. note:: OCI8 does not support ``lockForUpdate()`` together with ``limit()`` or
790+
``offset()`` because Oracle does not allow ``FOR UPDATE`` with row
791+
limiting.
790792

791793
.. _query-builder-union:
792794

0 commit comments

Comments
 (0)