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

    Hi,    I have tried what you suggested and put empty try catch blocks on the whole process.    From what it shows, the last line in the execution of the dll is showing to have completed.   However, some place between that time and the time before the next time I attempt a call to that dll, I get that error.   That leaves me to believe that it is having the issue when it is closing out the call and doing the internal finalize.    

    It was suggested that one of maybe a half dozen things can cause this.   Would they generally be due to issues outside the code or what might be a couple of the reasons.   When this crashes it seems like it is causing the exception outside of my apps ability to catch an error in it's .net code.

  • 0 in reply to SageJV

    It's hard to say without seeing your code and even that might not help. If you're just reading data from Sage then I'd be tempted to create an ADO connection and make straight database calls to avoid this. I agree that it should work but sometimes something odd happens that requires a restart. We have a process that will import thousands of shipments a day with no issue and then the next day it will process one hundred and will get stuck in some sort of fatal error that requires intervention and there's no indication of what is actually wrong.

Reply
  • 0 in reply to SageJV

    It's hard to say without seeing your code and even that might not help. If you're just reading data from Sage then I'd be tempted to create an ADO connection and make straight database calls to avoid this. I agree that it should work but sometimes something odd happens that requires a restart. We have a process that will import thousands of shipments a day with no issue and then the next day it will process one hundred and will get stuck in some sort of fatal error that requires intervention and there's no indication of what is actually wrong.

Children
No Data