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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mohammad dot saberi at gmail dot com
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2020 The PHP Group
All rights reserved.
Last updated: Fri Feb 28 21:01:29 2020 UTC