From: zotyo at srk dot ro
Operating system: win2k
PHP version: 4.3.2
PHP Bug Type: MSSQL related
Bug description: autocommit
Description:
------------
Thank you, but I'm not so sure that you're right about that. I think,
that the dll you are using to communicate with sql2k servers is commiting
every mssql_query() function. I think it should let sql to do it's work.
Thank you again, Zoltan Papp.
-----Original Message-----
From: PHP Bug Database <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Date: 8 Aug 2003 15:41:18 -0000
Subject: Bug #24987: autocommit
> From: zotyo at srk dot ro
> Operating system: Win2K
> PHP version: 4.3.2
> PHP Bug Type: MSSQL related
> Bug description: autocommit
>
> Description:
> ------------
> Hi,
>
> MSSQL 2000 is using autocommit. Normally I can turn this off by
> entering
> BEGIN TRANSACTION and can decide later to COMMIT or ROLLBACK the
> transaction. My problem is that I have the following code:
>
> MSSQL_PCONNECT($hostname,$username,$password) or DIE("DATABASE FAILED
> TO
> RESPOND.");
> mssql_select_db($dbName) or DIE("Table unavailable");
>
> mssql_query('BEGIN TRANSACTION');
>
> while($query = fgets($fp))
> {
> mssql_query($query);
> }
>
> mssql_query('ROLLBACK');
> ---
> Errormsg in browser:
>
> Warning: mssql_query(): message: The ROLLBACK TRANSACTION request has
> no
> corresponding BEGIN TRANSACTION. (severity 16) in
> c:\inetpub\wwwroot\php\restoredb.php on line 22
>
> Is there something I didn't understand related to PHP or is this is a
> bug?
> Pls. answer me, because i try to fix this problem since a week and
> tried a
> lot of things to trick this out and I have no ideea of what shall I do
> next... This would solve a huge problem of mine. A transaction from my
> page can contain over 2K of insert into -s and I have to rollback the
> transaction if one of the rows cannot be inserted.
>
> Thank you for your time, Zoltan Papp.
>
> Reproduce code:
> ---------------
> MSSQL_PCONNECT($hostname,$username,$password) or DIE("DATABASE FAILED
> TO
> RESPOND.");
> mssql_select_db($dbName) or DIE("Table unavailable");
>
> mssql_query('BEGIN TRANSACTION');
>
> while($query = fgets($fp))
> {
> mssql_query($query);
> }
>
> mssql_query('ROLLBACK');
>
>
> Expected result:
> ----------------
> Transaction Rolled Back.
>
> Actual result:
> --------------
> Warning: mssql_query(): message: The ROLLBACK TRANSACTION request has
> no
> corresponding BEGIN TRANSACTION. (severity 16) in
> c:\inetpub\wwwroot\php\restoredb.php on line 22
--
Edit bug report at http://bugs.php.net/?id=25041&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25041&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25041&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25041&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25041&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25041&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25041&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25041&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25041&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25041&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25041&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25041&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25041&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25041&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25041&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25041&r=gnused