Event Viewer Exception from Accpac internal dlls

I am using the Accpac.Advantage dlls to communicate from a third party .net app into Sage 300.    The processes we are doing are simply to open a connection and then return various pieces of information from view calls (I use the CS query view through an Accpac.Advantage.Session object.    This works fine for many calls but  periodically it seems that this process fails and as a result crashes the calling application as well.    After the failure, I can turn right around and process the exact same thing a subsequent time and it succeeds.    When it crashes, in the event log I see something like this (which given that the exact same flow can work several times in a row successfully I am somewhat stumped.   

Application: MySageIntegrationApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at AccpacCOMSVR.AccpacSvrViewClass.Close()
at ACCPAC.Advantage.Server.View.Dispose()
at ACCPAC.Advantage.View.Finalize()

I wondered if anyone else had seen anything else that might resemble this or if there were any suggestions of what could be happening.   As a note, I have seen this in a couple different instances both 2018 and 2019.  Note that I have not tried enough to say I do or do not see it on other versions.   Again, simply restarting the app allows the same exact flow to succeed.

Parents
  • 0

    There could be a half-dozen reasons for what you're seeing. I have automated stuff that will work for weeks and then suffer for three days and then go back to working.

    Given that the exception is being reported as unhandled I'd suggest wrapping everything in error handlers so that you can get a sense of where it is occuring.

  • 0 in reply to Django

    Thanks for the reply.  I am going to try to target the exact part where it is happening but from the looks of it I would guess that it happens as we are done using their objects and they are getting cleaned up (based on the finalize, dispose and close stack.

    You mentioned several things that might cause it.   In your case what had you found that caused it / what kinds of things might be some of the half dozen.   I guess what I am trying to figure out is if there is anything I might be able to suggest, is it likely it is my code, or is it as I thought- an issue inside of Sage's .net libraries trying to wrap around COM calls and things there are causing it.

Reply
  • 0 in reply to Django

    Thanks for the reply.  I am going to try to target the exact part where it is happening but from the looks of it I would guess that it happens as we are done using their objects and they are getting cleaned up (based on the finalize, dispose and close stack.

    You mentioned several things that might cause it.   In your case what had you found that caused it / what kinds of things might be some of the half dozen.   I guess what I am trying to figure out is if there is anything I might be able to suggest, is it likely it is my code, or is it as I thought- an issue inside of Sage's .net libraries trying to wrap around COM calls and things there are causing it.

Children
No Data