SAP Knowledge Base Article - Preview

2004765 - AccessViolationException periodically encountered in AseConnection.Close on a multi-threaded IIS application - SDK for SAP ASE


AccessViolationException periodically encountered in AseConnection.Close on a multi-threaded  IIS application  after connection to ASE times out.

Using the blocked remote i/o method to induce the timeout. That's where the middle tier calls a proc that does a select on a proxy table that has been locked on the remote server in exclusive mode.
Here's the sequence of events:

  • Presentation tier to middle tier timeout is 3:15. Middle tier to db tier timeout is 3:00
    0:00 middle tier calls proc that reads locked proxy table. DB spid is in remote i/o state, proxied to user account (as expected)
    3:15 presentation tier records timeout message
    6:02 driver returns error 30046 - "Connection to Sybase server has been lost. Connection died from command timeout. All active transactions have been rolled back." DB spid is still in remote i/o state, proxied to user account . It's interesting to note that error 30046 occurs at about 2x the database timeout. Other tests have shown the same timing.
    11:00 lock on remote table is released. DB spid is in recv sleep state, still proxied to user account (expected, since set proxy to MT account could not be executed)
    12:46 MT crashes. Message in ASE log: Cannot read, host process disconnected

    << windows application event log, >>

    Windows message:
    Application: Service.exe
    Framework Version: v4.0.30319
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.AccessViolationException
    at Sybase.Data.AseClient.Unmanaged.CloseConnection(IntPtr)
    at Sybase.Data.AseClient.AseConnectionImpl.Close()
    at Sybase.Data.AseClient.AseConnectionImpl.Finalize()

    Faulting application name: Service.exe, version:, time stamp: 0x524d07f3
    Faulting module name: unknown, version:, time stamp: 0x00000000
    Exception code: 0xc0000005
    Fault offset: 0x206e6f69
    Faulting process id: 0x7d4
    Faulting application start time: 0x01cebffdfb88d4a3
    Faulting application path: Service.exe
    Faulting module path: unknown
    Report Id: e99cd51a-2c30-11e3-949c-8631cddad159

    << nothing recorded in system event log >
  • In a previous test with timing similar to the above, the MT crashed with the message:
    << windows system event log >>
    Application popup: Microsoft Visual C++ Runtime Library : Runtime Error!

    Program: C:\Service.exe

    - pure virtual function call

    << windows application event log >>

    Faulting application name: Service.exe, version:, time stamp: 0x524bb681
    Faulting module name: sybdrvado20.dll, version: 2.157.1101.0, time stamp: 0x52427071
    Exception code: 0x40000015
    Fault offset: 0x0006cb89
    Faulting process id: 0x2f94
    Faulting application start time: 0x01cebf3536dc2835
    Faulting application path: WCFService.exe
    Faulting module path: C:\Windows\TEMP\Sybase.AdoNet4.AseClient.32bits.4.157.1101.0\sybdrvado20.dll
    Report Id: a1e0f285-2b61-11e3-b5ad-663a32047475



  • SAP Sybase Software Developer Kit (SDK) 15.7 SP110
  • Adaptive Server Enterprise ADO.NET Data Provider
    • 4.0 Provider ( Sybase.AdoNet4.AseClient.dll )
  • .net 4


Sybase SDK 15.7 ; Sybase Software Developer Kit 15.7


KBA , BC-SYB-SDK , SDK , BC-SYB-ASE , Sybase ASE Database Platform (non Business Suite) , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.