Phalanger
Phalanger copied to clipboard
PhpNetMsSql Transactions Bug on Mono/Linux
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.
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
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
I agree.