php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5803 odbc_rollback fails with MS Access DB but returns true anyway
Submitted: 2000-07-26 23:37 UTC Modified: 2000-07-27 09:15 UTC
From: vladimir dot prilepsky at roche dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.0.0 OS: WinNT 4.0
Private report: No CVE-ID: None
 [2000-07-26 23:37 UTC] vladimir dot prilepsky at roche dot com
I have a hard time to abort transaction
I'm using Access 97

$connection_id=odbc_connection("DSN","","",);
$result=odbc_exec($connection_id, "Select * from table");
odbc_result_all($connection_id);
//prints 5 rows

$result=odbc_exec($connection_id, "Delete * from table where ID=1");
$ suc=odbc_rollback($connection_id);
echo "$suc";
//prints 1 it means rollback succed

$result=odbc_exec($connection_id, "Select * from table");
//prints 4 rows 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-27 09:15 UTC] kara@php.net
By default, odbc connections are in autocommit mode. Use odbc_autocommit to toggle this off.
Odbc_rollback() tries to rollback outstanding transactions on the connection, if there aren't any, this is still considered as success. Only "real" errors, such as not being able to rollback a transaction will return failure.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 23:01:32 2024 UTC