Skip to Content

Issue B1_DIInternalFields90.dll w3wp.exe crashes

Hello Everyone,

Overview about my app :

I have created the web-service (asmx) and integrated DIAPI in it. I am exposing Add Business Partner and Update Business Partner method. Those 2 method will help caller application to Add / Update business partner through our services. One more thing : user will be sending single business partner at a time for any of the 2 operation. In short if the user want to add 1000 business partner then the caller application will call our services 1000 times & the same for update method as well. In short its one BP at a time.

Issue :

When the user performs this action in bulk for e.g 10000 BP for Add / Update then at some points w3wp process crashes & below are the issue details I have trapped in th event viewer pls have a look at it. Suggest me solution on this error :

Faulting application name: w3wp.exe, version: 8.5.9600.16384, time stamp: 0x52157ba0
Faulting module name: B1_DIInternalFields90.dll, version: 9.20.150.0, time stamp: 0x581712a4
Exception code: 0xc0000005
Fault offset: 0x00013eb5
Faulting process id: 0xe54
Faulting application start time: 0x01d2bb2a098e0a4b
Faulting application path: C:\Windows\SysWOW64\inetsrv\w3wp.exe
Faulting module path: C:\Program Files (x86)\SAP\SAP Business One DI API\DI API 90\B1_DIInternalFields90.dll
Report Id: 57109d74-2727-11e7-8188-029f6db918f5
Faulting package full name: 
Faulting package-relative application ID: 

Some in-sights about my code :

Previously I thought I was not disposing the object appropriately so I doubled checked & didn't any issue so have a look at my below code and let me know in-case of any changes required.

BusinessPartners objBusinessPartners = null;
ContactEmployees oBPContactPerson = null;
SAPbobsCOM.Company oCmpy = null;
try
{

// Setting some logic for oCmpy connection object
oCmpy.Connect();


objBusinessPartners = (SAPbobsCOM.BusinessPartners)oCmpy.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners);
Some Logic

}
finally
{
if (oCmpy.Connected == true) { oCmpy.Disconnect(); System.Runtime.InteropServices.Marshal.FinalReleaseComObject(oCmpy); oCmpy = null; }
if (objBusinessPartners != null) { System.Runtime.InteropServices.Marshal.FinalReleaseComObject(objBusinessPartners); objBusinessPartners = null; }
if (oBPContactPerson != null)
{
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(oBPContactPerson); oBPContactPerson = null; }

Guys I feel I am able to explain in-detail but if in-case of any additional information pls pls do let me know & awaiting for your feedback.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    May 01, 2017 at 06:23 AM

    Everyone,

    I was struggling on this issue for such a long time & I tried alot from my side to fix but nothing was seems to work so me along with my mate Mr Pravin have sat for one last time & this time we managed to fix this issue.

    Fix : I was opening & closing the connection everytime in my Add & Update method because of which w3wp.exe was getting crashed, so please open this connection only 1 time which I handled in Global.asax file. If anyone looking out for the code pls PM me will be glad to help anyone.

    Also about this error : Faulting modulename: B1_DIInternalFields90.dll there are quite a number of possibility where I stumble upon this issue & those are as follows :

    1. Passing NULL Instead of blank.
    2. Passing '' where we have master values in the dropdown but we have not added '' as an option in the list.

    So ping me up, Will be glad to help anybody facing this issue.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Rahul,

      Could you please share how you accomplished opening the connection only once? I am trying to insert into SAP B1 asynchronously...but am sometimes getting the message in the Event log described above.

      I am basically looping through and opening/closing the connection each time via a using statement:

      using (var companyHandler = new B1CompanyHandler())
      {
      Documents orderDocument = null; try
      {
      _sboCompany = companyHandler.SBO_Company;
      orderDocument = (Documents)_sboCompany.GetBusinessObject(BoObjectTypes.oOrders);

      processor(orderDocument);
      }
      catch (Exception ex)
      {
      ...
      }
      finally
      {
      orderDocument = null;
      _sboCompany = null;
      }
      }

      Thank you

  • Apr 24, 2017 at 12:29 PM

    Hi Rahul,

    Look this link: https://www.appseconnect.com/di-api-memory-leak-in-sap-business-one-9-0/ maybe helps you.

    Kind Regards,

    Diego Lother

    Add comment
    10|10000 characters needed characters exceeded

  • May 09 at 06:34 AM

    Hi, I hope this helps someone.

    in my service I had the same problem.

    I solved it by keeping the connection active. I solved it by keeping the connection active, that is, never release or disconnect the object "Company".

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

    • Could you please share how you accomplished this? I am trying to insert into SAP B1 asynchronously...but am sometimes getting the message in the Event log described above.