Skip to Content
0
Mar 30, 2020 at 11:23 AM

IIS / Company Transaction Problem

203 Views

We are using SAP B1 10 PL00 on sql server 2014.

We write webservice application and publish it to IIS 10.

We are using DI API at web service.

When one user call method there is no problem(creates and update all documents)

But if more than one user calls method same time sql crashes and deadlock.

I need help, Please

       int lRetCode = oCompany.Connect(); 
        if (lRetCode != 0) 
            return false; 
        if (!oCompany.InTransaction) 
            oCompany.StartTransaction();
        
        Documents doc = (Documents)oCompany.GetBusinessObject(BoObjectTypes.oPurchaseDeliveryNotes);
        doc.CardCode = cardCode; 
        //   ....... 
        lRetCode = doc.Add(); 
        if (lRetCode != 0) 
            return false; 
        else
            { //....... do some update }
        if (oCompany.InTransaction) oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit);