Skip to content

Commit 508d836

Browse files
docs: keep the OCI8 reconnect note on the OCI8 connection
The inline comment repeated the reconnect() docblock. The commit-mode restore belongs on OCI8\Connection. The user guide still says OCI8 returns to autocommit. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent e8bfeca commit 508d836

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎system/Database/BaseConnection.php‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,7 @@ public function close()
628628
* A replaced socket is not in the transaction that was open on the old
629629
* one. The server has already rolled that work back. Clear the depth and
630630
* mark the transaction failed before opening the new connection, so a
631-
* failed reconnect cannot still report success. OCI8 also returns its
632-
* commit mode to autocommit.
631+
* failed reconnect cannot still report success.
633632
*
634633
* @return void
635634
*/
@@ -640,8 +639,6 @@ public function reconnect()
640639

641640
$this->close();
642641

643-
// initialize() can throw. Clear the lost transaction first so a
644-
// failed reconnect cannot still report the old transaction.
645642
if ($lostTransaction) {
646643
$this->abandonLostTransaction();
647644
}
@@ -654,8 +651,7 @@ public function reconnect()
654651
* The socket that owned the transaction is already closed.
655652
*
656653
* Drivers that keep transaction state in PHP, rather than only on the
657-
* server, must override this. OCI8 commit mode is one case: leaving it
658-
* at OCI_NO_AUTO_COMMIT makes later writes uncommitted.
654+
* server, must override this.
659655
*/
660656
protected function abandonLostTransaction(): void
661657
{

‎system/Database/OCI8/Connection.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,10 @@ protected function _transRollback(): bool
722722
return oci_rollback($this->connID);
723723
}
724724

725+
/**
726+
* Restore OCI_COMMIT_ON_SUCCESS. close() does not, and
727+
* OCI_NO_AUTO_COMMIT would leave later writes uncommitted.
728+
*/
725729
protected function abandonLostTransaction(): void
726730
{
727731
$this->commitMode = OCI_COMMIT_ON_SUCCESS;

0 commit comments

Comments
 (0)