Automatic reconnect / Long running transactions

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
bastian
Posts: 3
Joined: Tue 13 Apr 2021 06:45

Automatic reconnect / Long running transactions

Post by bastian » Wed 04 Aug 2021 08:26

Hello,

we are using the devArt dbExpress Database driver for SQL Server. One of our clients seems to have connection interruptions to the database. This is handled nicely because there is an automatic reconnect in the driver.

Now, sometimes the following error occurs: "Cannot create new connection because in manual or distributed transaction mode" (in German, but that does not matter).

Part of out product is a very long running transaction while importing data. If a connection error occurs during that transaction, would it trigger a reconnect and that produce that error? MARS (multiple active result sets) are currently disabled, would this help in this scenario?

I'm (almost) sure that we don't automatically reconnect or create new connections during the transaction and we already have indications that connection errors could be possible at the client site.

Can you give us a hint what to do in such a situation? As an external software provider, we have no influence to the connection quality at the client site.

Thanks for your help,
Bastian

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

Re: Automatic reconnect / Long running transactions

Post by Stellar » Mon 06 Sep 2021 07:59

Hi,

Thank you for your reply.
Which driver are you using to connect to MS SQL Server (DevartSQLServer or DevartSQLServerDirect)?

Looking forward to your reply!
Best regards,
Sergey,
Devart Support Team

bastian
Posts: 3
Joined: Tue 13 Apr 2021 06:45

Re: Automatic reconnect / Long running transactions

Post by bastian » Mon 13 Sep 2021 06:42

Hi,

we are using the DevartSqlServer driver (purchased version 8.3.1).

Thank you for your reply!

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

Re: Automatic reconnect / Long running transactions

Post by Stellar » Wed 22 Sep 2021 10:47

Hi,

Thanks for your request.
We've reproduced the issue and started to investigate possible causes of the described behavior.
We will let you know the results as soon as we get them.

Best regards,
Sergey,
Devart Support Team

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

Re: Automatic reconnect / Long running transactions

Post by Stellar » Mon 27 Sep 2021 14:48

Hi,

We have fixed the issue, and the fix will be included in the next dbExpress Driver for SQL Server build.

In case you have any further questions about our products, please feel free to contact us any time!

Best regards,
Sergey,
Devart Support Team

bastian
Posts: 3
Joined: Tue 13 Apr 2021 06:45

Re: Automatic reconnect / Long running transactions

Post by bastian » Mon 04 Oct 2021 07:59

Hello,

thank you for fixing this issue.
Can you share some details in what kind of issue this was? Or a link to the issue description?

We are developing a complex product which runs at different clients, so before we can update the database access drivers we have to test the new driver in different parts of the product. As the reported error occurs only intermittently, additional information would help us to decide when we update our driver. For reference, can you please add the version number, in which the issue was fixed.

best regards,
Bastian

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

Re: Automatic reconnect / Long running transactions

Post by Stellar » Thu 07 Oct 2021 14:51

Hi Bastian!

Thank you for your reply!

We have added the support for Multiple Active Result Sets (MARS) technology, these changes will be included in the next version of the driver. To activate MARS, set the 'MultipleActiveResultSets' connection option to 'True',
For example:

Code: Select all

SQLConnection1.DriverName := 'DevartSQLServer';
SQLConnection1.LibraryName := 'dbexpsda41.dll';
SQLConnection1.VendorLib := 'sqlncli11.dll';
SQLConnection1.GetDriverFunc := 'getSQLDriverSQLServer';

SQLConnection1.Params.Clear;
SQLConnection1.Params.Add('VendorLib=sqlncli11.dll');
SQLConnection1.Params.Add('HostName=server_name');
SQLConnection1.Params.Add('User_Name=sa');
SQLConnection1.Params.Add('Password=pwd');
SQLConnection1.Params.Add('Database=db_name');
SQLConnection1.Params.Add('MultipleActiveResultSets=True');
SQLConnection1.Connected := True;
 
If you have an active subscription, then we can provide you with a nightly build of the driver with the latest changes.
For this, please send us your license number, and we will send it to you.

Best regards,
Sergey,
Devart Support Team

Post Reply