MS SQL Server batch update transaction error

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
oh_ha
Posts: 4
Joined: Mon 30 Jan 2017 20:11
Location: Munich, Germany

MS SQL Server batch update transaction error

Post by oh_ha » Thu 04 May 2017 13:34

Hello,
I want to perform a batch insert using the methods described in your blog post "Using Batch Updates in Delphi Data Access Components" (http://blog.devart.com/using-batch-oper ... nents.html). This should happen as part of an already open transaction. The problem is that calling "Execute" leads to the following error message: "Project XXX.exe raised exception class EOLEDBError with message 'Cannot start more transactions on this session.'".

In the releases notes for UniDac v7.0.1 it says for Firebird / Interbase: "Possibility to manage batch operations using a transaction is added". Is this still an issue when targeting SQL Server? If so, is there a workaround? If possible, all changes to the database should happen in the same transaction.

I am using Unidac v7.0.1 with Delphi XE Pro; the database server is MS SQL Server 2016.

Thanks and regards, Olaf

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

Re: MS SQL Server batch update transaction error

Post by azyk » Fri 05 May 2017 13:13

We cannot reproduce the specified problem. Please, compose a small test project which demonstrates it and send to us by using the contact form on our website: http://www.devart.com/company/contactform.html .

oh_ha
Posts: 4
Joined: Mon 30 Jan 2017 20:11
Location: Munich, Germany

Re: MS SQL Server batch update transaction error

Post by oh_ha » Mon 08 May 2017 07:39

As requested I have uploaded an example.

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

Re: MS SQL Server batch update transaction error

Post by azyk » Thu 11 May 2017 12:02

Thank you for the sent sample. We reproduced the problem and fixed it. The fix will be included in the next UniDAC build.

Post Reply