SQL Server transaction question
Posted: 13.09.2020, 13:59
Hi All!
I'm doing some testing with the 7.3 beta and SqlServer. I'm using the oledb driver as from my research it appears to be the correct one to use for recent SQL Server releases. I haven't been able to get transactions to work properly with it and have had to fall back to always using autocommit. The other database protocols seem to work well with going with the default ReadCommitted isolation level (or changing it for MySQL), but I must be misunderstanding how transactions work in oledb? I'm used to:
Set TransactionIsolationLevel to ReadCommitted
Connect
.. do work ..
Commit/Rollback
I've tried adding StartTransaction when using OLEDB/SQL Server, but it doesn't seem to work (if it's useful I can give the errors and what I'm trying.) The error I see when trying to run a query after connecting after setting ReadCommited is:
Project raised exception class EZSQLException with message 'SQL Error: OLEDB Error
Error message: Cannot create new connection because in manual or distributed transaction mode.
Source: Microsoft OLE DB Driver for SQL Server
Code: -2147467259 SQL: IDBSchemaRowset.GetRowset'.
Any thoughts or suggestions appreciated!
-Mark
I'm doing some testing with the 7.3 beta and SqlServer. I'm using the oledb driver as from my research it appears to be the correct one to use for recent SQL Server releases. I haven't been able to get transactions to work properly with it and have had to fall back to always using autocommit. The other database protocols seem to work well with going with the default ReadCommitted isolation level (or changing it for MySQL), but I must be misunderstanding how transactions work in oledb? I'm used to:
Set TransactionIsolationLevel to ReadCommitted
Connect
.. do work ..
Commit/Rollback
I've tried adding StartTransaction when using OLEDB/SQL Server, but it doesn't seem to work (if it's useful I can give the errors and what I'm trying.) The error I see when trying to run a query after connecting after setting ReadCommited is:
Project raised exception class EZSQLException with message 'SQL Error: OLEDB Error
Error message: Cannot create new connection because in manual or distributed transaction mode.
Source: Microsoft OLE DB Driver for SQL Server
Code: -2147467259 SQL: IDBSchemaRowset.GetRowset'.
Any thoughts or suggestions appreciated!
-Mark