php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61199 SQLSRV problem to create new Transaction
Submitted: 2012-02-28 07:38 UTC Modified: 2020-02-07 14:50 UTC
From: mohammad dot saberi at gmail dot com Assigned: cmb (profile)
Status: Closed Package: sqlsrv (PECL)
PHP Version: 5.3.10 OS: Windows 7
Private report: No CVE-ID: None
 [2012-02-28 07:38 UTC] mohammad dot saberi at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.sqlsrv-begin-transaction.php
---
I've used SQLSRV driever ver.2 with PHP. I must use SQL Transactions in my codes. 
But I get this error sometimes:
"New transaction is not allowed because there are other threads running in the 
session"

I updated SQL SERVER Native client too, but it could not solve anything.

Test script:
---------------
<?php
// This is my psudo code
if (sqlsrv_begin_transaction( $sqlsrv->sqlsrvLink ) === true) {

   $firstQuery = sqlsrv_query($stmt1);
   if (!$firstQuery) {
      sqlsrv_rollback();
   } else {
      $nextQuery = sqlsrv_query($stmt2);
      if (!$nextQuery) {
         sqlsrv_rollback();
      } else {
         sqlsrv_commit();
      }
   }

}
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-28 08:51 UTC] pajoye@php.net
-Package: Unknown/Other Function +Package: sqlsrv
 [2012-02-28 08:51 UTC] pajoye@php.net
fix package
 [2020-02-07 14:50 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-02-07 14:50 UTC] cmb@php.net
If you still experience this issue, please file a bug report at
<https://github.com/Microsoft/msphpsql/issues>.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 10:01:29 2024 UTC