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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
45 + 48 = ?
Subscribe to this entry?

 
 [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: Sat Feb 22 20:01:28 2020 UTC