cancel
Showing results for 
Search instead for 
Did you mean: 

DI API error "Could not commit transaction: Error -1 detected during trans"

Former Member
0 Kudos

I have a large collection of journal vouchers that I post in three different SAP companies. Each journal voucher contains between 2 and 5 entries. Once all calculation is done I go to commit all three transactions (it's required to be done this way). One of the DBs almost always fails when I try to do this during business hours (when users are logged in), the other two never create problems and I never have a problem if I do it in the middle of the night when only other DI API and DI Server applications are running. The error that I get is: "Could not commit transaction: Error -1 detected during transaction". The journal voucher that fails contains one entry with 1500+ lines it it (it's required to be done this way). Is there some way that I can prioritize my application above the users so that i can get this to work without forcing user out?

We are using SAP Business One 8.82, but this problem has existed since we were on 2007A.

we are using MSSQL 2005

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Are you using async await task in your program?
I noticed this error in all my company add-on that uses async await to communicate with the di api.

I may need to stick with synchronous thread execution until i get a better way to make use multi threads with di api.

Johan_H
Active Contributor
0 Kudos

As Gordon said, a tramsaction of that size is simply too large to commit when the system is in full use.

If these transaction are created by a user (so outside business hours is not an option), you may want to consider a repository approach.

Instead of committing the transaction directly to the B1 system, you could create (for example) XML files to a repository folder (protected if necessary), and then have a console app convert the files into transactions during the night.

Former Member
0 Kudos

Hi,

For this to work, you cannot let it run in the business hours. It will surely fail if you have document that large. Try run it in non-business hours.

Thanks,

Gordon