Hi,
On the web server we get this error by w3wp.exe (observer in application system event log) - it causes system level exception. So the application does not work after that.
Error Trace
Faulting application w3wp.exe, version 6.0.3790.3959, faulting module kernel32.dll, version 5.2.3790.4480, fault address 0x0000bef7.<br />
Exception: System.AccessViolationException<br />
Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.<br />
StackTrace: at OSGeo.MapServer.mapscriptPINVOKE.new_mapObj(String jarg1)<br />
at OSGeo.MapServer.mapObj..ctor(String filename)<br />
at PostGreSQLServerSpatialQuery.GetKMLByPolygon(String[] oBoundingBox);<br />
So it is found that in one of the modules it throws this exception.
How can I make sure that even if the
System.AccessViolationException
exception occurs application keep on working.For now I have added the code snippet which can cause this exception in a try catch block and I exit from the function where it it causes the exception
as
(The code is in a web service)
function ...
try
try
code which can cause exception
catch
exit function;
end try
catch ex as exception
finally
end try
end function
here I am preventing the exception to go to next level.
Do you think this is the right approach where even if it caused System
AccessViolationException the application will still be working.
Do you have any better approach?
Thanks
Vijay