cancel
Showing results for 
Search instead for 
Did you mean: 

"Could not commit transaction: Error -1 detected during transaction"

Former Member
0 Kudos

hi,

When I use wf_commit I sometimes get this error "Could not commit transaction: Error -1 detected during transaction" but when I step through code i cannot see any errors, does anyone have any suggestion how I shall find the problem?

I'm runnig this in 8.8 pl18 in a SQL2008.

Thanks in advance.

Ulf

rahuljain257
Participant
0 Kudos

Just to help for other person for finding the solution - I also came across the issue and the root cause was the validation I put in the transaction notification. Initially I disable the transaction notification and then i got the pointers to fix the issue.

Accepted Solutions (0)

Answers (7)

Answers (7)

yulia_lashina
Explorer
0 Kudos

Hi,

I have the same problem. As I try to add a sales order I get an error: Could not commit transaction: Error -1 detected during transaction.

There is nothing on SP POST or SP TRANSACTIONS.

I am using SAP version 9 pl05

Did you find a solution for this problem?

Thanks in advance,

Yulia

Former Member
0 Kudos

hi. Yuila lashina..

Actually the problem is comming bcz of stored  procedure  but you are saying there is no sp in your data base..

is there any addon is running..

if it is yes.

check in coding is there any  transaction starting..

if yes check it in what cases  it is starting and  stoping..

every start it should need end ...

--------

if there is no  transaction in coding or no addon is  running..

try to restart the  sql server ... and add again...

former_member209771
Active Participant
0 Kudos

Hi Ulf Larsson ,

I think this is Store procedure problem . If you post your SBO_SP_TransactionNotification then i can help you .

Thanks and Regards

Surajit

Former Member
0 Kudos

The problem is that the return values are always correct and if I take way the transaction handling it works without errors.

Former Member
0 Kudos

This SP_TN can cause such trouble. You need to make sure which one is priority. Certain things may not be satisfied 100%.

former_member534143
Discoverer
0 Kudos

hi guys, i also have this error. program is working fine if there's no transaction handling. we'r using B1 8.8, dbms is ms sql 2008, and we have no codes placed in SP_TN.

here's the weird part, same program (w/ transaction handling) WORKS when using B1 8.8, dbms is ms sql 2005.

seems this issue can be related to dbms.

please please help, thanks.

Edited by: Emmanuel Pante on Jan 3, 2012 5:39 AM

Former Member
0 Kudos

Hi Ulf,

Did you ever find the solution?

Thanks,

Andy.

Former Member
0 Kudos

Hi larson,

With out Transaction handling,if your addon is working fine means this might not be a problem of SP_TN.

It seems like problem in transaction handling only.

sg2707
Participant
0 Kudos

Did you find any solution? I saw that my problem is the same as what you mentioned.

sg2707
Participant
0 Kudos

Any solution?

sg2707
Participant
0 Kudos

Symptom

The following error occurs when you do query to "select Top 1" in DI API.

"ERROR: System.Runtime.InteropServices.COMException (0xFFFFFBA4): Could not commit transaction:Error -1 detected during transaction en SAPbobsCOM.CompanyClass.EndTransaction(BoWfTransOpt endType)"

Reproducing the issue

Use the following sample code:

oCompany.StartTransaction()

Dim sql As String = "SELECT TOP 1 ""CardCode"" FROM ""OCRD"""

Dim rs As SAPbobsCOM.Recordset
rs = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
rs.DoQuery(sql)

If rs.RecordCount > 0 Then
   rs.MoveFirst()
   While Not rs.EoF
      rs.MoveNext()
   End While
End If

If oCompany.InTransaction Then
   oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit)
End If

Actual Result:

ERROR: System.Runtime.InteropServices.COMException (0xFFFFFBA4): Could not commit transaction:Error -1 detected during transaction en SAPbobsCOM.CompanyClass.EndTransaction(BoWfTransOpt endType)

Expected Result:

No errors and successful commit

Cause

Application Error

Workaround:

The issue occurs when you use TOP 1 (when there is only one row). MoveFirst() and MoveNext() is not required when record count = 1.

Use the following logic to avoid errors:

If rs.RecordCount > 1 Then
   rs.MoveFirst()
   While Not rs.EoF
      rs.MoveNext()
   End While
End If

Former Member
0 Kudos

Hi, Gordon,

If you by DTW mean Data Transfer Workbench I am not using that. this is an addon.

Former Member
0 Kudos

I choose the wrong word. I really mean by DI API.

Former Member
0 Kudos

This is a return document that I crete using DIAPI and some deliveries is just impossible to commit and some is no problem.

In SBO_SP_TransactionNotification we have added som control that profitcentre and project is entered.

Former Member
0 Kudos

DTW file may add certain documents that are not compatible with existing documents. Check the detail of the documents to find out what is wrong.

Former Member
0 Kudos

Are there anything in sp_TransactionNotification or sp_PostTransaction?

Former Member
0 Kudos

Hi Ulf,

If your issue is sometimes, how often do you get the problem? Half time or only occasionally?

Thanks,

Gordon