Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121811 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 55162 invoked from network); 26 Nov 2023 02:30:58 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Nov 2023 02:30:58 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2C30718002F for ; Sat, 25 Nov 2023 18:31:03 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail.sakiot.com (mail.sakiot.com [160.16.227.216]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 25 Nov 2023 18:31:01 -0800 (PST) Received: from smtpclient.apple (softbank060067217005.bbtec.net [60.67.217.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id C24E8401DD for ; Sun, 26 Nov 2023 11:30:52 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1700965852; bh=0yHhs7//KNTHSUktg2vEH9zpsm2FLXx1x8Kf8It1HSA=; h=From:Subject:Date:To:From; b=VxhCRUBhTlD724YFptdU1zswZSW11KhNJ0eCiNwSyNLRMJYNu9XuH1K1EuaHbOZSb KpFL+yiBJbfQLsfSVSBtUZZW3hHEgfzzhWor1hfsjVYFrFPsuo/YySLjFEsYd36hep O1vkQe4gqKk7qSM5SX7Y/Q0LGjGA2ueu5B5KuWOI= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Message-ID: <17F3158B-EB1C-4546-A24D-F7DA957BA4B7@sakiot.com> Date: Sun, 26 Nov 2023 11:30:40 +0900 To: PHP internals X-Mailer: Apple Mail (2.3731.700.6) Subject: [PDO] I want to unify the behavior when changing the autocommit mode setting while a transaction is open. From: saki@sakiot.com (Saki Takamachi) Hi internals, The following code: ``` $db =3D new PDO(/* omission */, [PDO::ATTR_ATUOCOMMIT =3D> 0]); $db->beginTransaction(); $db->setAttribute(PDO::ATTR_ATUOCOMMIT, 1); ``` The behavior in this case varies depending on the DB driver and is not = unified. MySQL, OCI, ODBC, and Firebird currently support PDO autocommit = mode. - MySQL always sets the new mode regardless of the state of the = transaction, resulting in an implicit commit. - OCI does an explicit commit and sets the new autocommit mode. - Firebird raises an error. - ODBC does not implement this behavior in the first place (it is a bug) I believe that code that changes the autocommit mode with a transaction = open is usually just forgetting to close the transaction. Therefore, in = such cases, I would like to unify the behavior by generating an error = like Firebird. I would appreciate any feedback on this proposal and whether this change = requires an RFC. Regards. Saki=