Page 1 of 1

DBLoader and transactions on SQL Server

Posted: Tue 08 Dec 2015 12:44
by Licences AAW
[Unidac 6.1.5]

Hello,

as continuation of this thread, I'm facing a new problem.
So, then I use 2 dbloaders to insert data in the table: one with DefaultFields with a specific value I want in the recordset, and an other without DefaultFields to let the server apply the DEFAULT constraints.

But, if the second dbloader produce an error because of a field value not matching database constraint (DEFAULT one or any other), I would have the first dbloader being reverted.

As it seems the DBLoader is not allowed to use a transaction with SQL Server, I can't find a way to "cancel" the first dbloader.
I tried to use a global transaction on the connection, but DBLoader doesn't allow this to.

So, I'm looking for something (a trick, an official property/code) to be able to "cancel" a loader action.
Is it even possible?

Re: DBLoader and transactions on SQL Server

Posted: Fri 11 Dec 2015 13:11
by azyk
When you use TUniLoader for SQL Server, it uses the IRowsetFastLoad.InsertRow method to add rows to the bulk copy rowset. When all records are inserted, TUniLoader calls the IRowsetFastLoad.Commit method to write the rows to the SQL Server table. We will investigate the possibility to change this behavior and inform you about the result.