Possible bug: SQL Server Transaction Isolation Level cannot be set to Snapshot using prDirect

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

Possible bug: SQL Server Transaction Isolation Level cannot be set to Snapshot using prDirect

Post by ertank » Mon 12 Dec 2016 15:44

Hello,

I am using Delphi 10.1 Update 2, SQL Server 2016 Express 64bit, UniDac 6.4.16.

I have searched the forum and read that I can use something like:

Code: Select all

UniConnection1.Close();
UniConnection1.DefaultTransaction.IsolationLevel := ilSnapshot;
UniConnection1.Open();
Above code will enable snapshot isolation level *if* database has below option set:

Code: Select all

ALTER DATABASE <db_name> 
SET ALLOW_SNAPSHOT_ISOLATION ON;
I know that I can check if snapshot is enabled using SQL Server Profiler. I should see below line just after connection is established:

Code: Select all

SET TRANSACTION ISOLATION LEVEL SNAPSHOT
Assuming all above set correctly, I should have a snapshot isolation level.

However, this does not work if provider is set to prDirect. Sample project including a small database backup can be found in below link
https://mega.nz/#!G9lH3JoS!_7qdxjUBiNQn ... EB0U6T3sgg

I appreciate a feedback as to that situation can be reproduced on Devart side, please.

Thanks.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Possible bug: SQL Server Transaction Isolation Level cannot be set to Snapshot using prDirect

Post by azyk » Wed 14 Dec 2016 12:02

Thank you for the sent sample. We reproduced the described behavior in the Direct mode and are investigating it. We will inform you about the results.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Possible bug: SQL Server Transaction Isolation Level cannot be set to Snapshot using prDirect

Post by azyk » Tue 27 Dec 2016 14:26

We will fix this behavior. Currently, in order for ISOLATION LEVEL to be set for a transaction in Direct mode, after establishing connection call the StartTransaction method, for example:

Code: Select all

UniConnection1.Close();
UniConnection1.DefaultTransaction.IsolationLevel := ilSnapshot;
UniConnection1.Open();
UniConnection1.StartTransaction;

Post Reply