Re: Re: MDB 2.x
| From: | Michael Wallner | Date: | Mon, 25 Aug 2003 16:17:00 +0000 |
| Subject: | Re: Re: MDB 2.x | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-20494@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> The sequence query should look like:
> INSERT INTO seq_table DEFAULT VALUES
Hi,
some thoughts concerning transactions:
1) ROLLBACK
There was made a little copy&paste mistake in
MDB_mssql::rollback()
COMMIT TRANSACTION
is dropped immediately before
ROLLBACK TRANSACTION
2) AUTOCOMMIT
Hm, MDB_mssql uses implicit transactions[1]
by calling BEGIN and COMMIT itself.
I think that behavior gets too complicated...
Let me try to explain:
IF we call MDB_mssql::autoCommit(true/false)
MDB is dropping a BEGIN/COMMIT, but if there
was no BEGIN before the COMMIT MSSQL throws
an error.
MSSQL is in AUTOCOMMIT mode as default.
[1]
So if we want to keep the behavior
of implicit transactions we can use
MSSQL's SET IMPLICIT_TRANSACTION ON/OFF
and do not have to worry about BEGIN's
and COMMIT's.
MDB_mssql::autocommit(true)
SET IMPLICIT_TRANSACTIONS OFF
MDB_mssql:autocommit(false)
SET IMPLICIT TRANSACTIONS ON
I made some changes to MDB/mssql.php which
adresses above issues, please tell me what
you think about that.
All tests pass, but not MDB_manager_testcase.
It also passes, but it doesn't create the table
files, which causes the other testcases to fail.
You can find a diff and the test log attached.
Michael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (Cygwin)
iD8DBQE/SjZ83645gzRPvy8RAtBoAJ0WwQo2in/hj9Xcds8YpNIKElesTgCfeyIL
vK1M+Brml6kLoglPxHj3Oh4=
=GLzD
-----END PGP SIGNATURE-----