Skip to content
This repository has been archived by the owner on Oct 23, 2019. It is now read-only.

PhpNetMsSql Transactions Bug on Mono/Linux #29

Open
kripper opened this issue May 20, 2014 · 3 comments
Open

PhpNetMsSql Transactions Bug on Mono/Linux #29

kripper opened this issue May 20, 2014 · 3 comments

Comments

@kripper
Copy link

kripper commented May 20, 2014

Using managed extension "PhpNetMsSql"...

$con = mssql_pconnect('<host>,<port>', '<user>', '<pass>');
mssql_select_db('<database>');
mssql_query('BEGIN TRANSACTION');

Throws:

Warning: mssql_query(): Command execution failed: Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 0, current count = 1.

This happens only on Mono/Linux. On Windows, it's working fine.

@kripper kripper changed the title PhpNetMsSql and Begin on Mono/Linux PhpNetMsSql Transactions Bug on Mono/Linux May 21, 2014
@kripper
Copy link
Author

kripper commented May 21, 2014

Mono doesn't support calling ExecuteReader() for NonQuery commands like "BEGIN TRANSACTION" or "SET ...".
ExecuteNonQuery() must be used instead.

Bug reported to the Mono project:
https://bugzilla.xamarin.com/show_bug.cgi?id=19950

@kripper kripper closed this as completed May 21, 2014
@kripper kripper reopened this May 21, 2014
@jakubmisek
Copy link
Member

It would be hard to recognize whether ExecuteNonQuery or ExecuteReader has to be used (without parsing the expression which would cost performance), so the only way would be to wait for fix in mono

@kripper
Copy link
Author

kripper commented May 21, 2014

I agree.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants