Error in Managed .NET Sybase Provider

Getting this error with your Sybase .NET driver? There is limited discussion that I found via Google, so I thought I would mention the solution here:

++++++++++++++++++++++++++++++++

ERROR Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

at at Sybase.Data.AseClient.Unmanaged.ExecuteCommand(IntPtr pCommandHandle)

at Sybase.Data.AseClient.AseCommand.Execute()

at Sybase.Data.AseClient.AseCommand._ExecuteReader(CommandBehavior commandBehavior)

at Sybase.Data.AseClient.AseCommand.System.Data.IDbCommand.ExecuteReader()

++++++++++++++++++++++++++++++++

To fix this, contact Sybase and get the latest managed driver from August 2008:

Sybase.AdoNet2.AseClient.dll and Sybase.AdoNet.AseClient.dll

Version: 1.15.325.0

Released 15th August 2008

The difference between the 2 DLL’s is that one is for .Net 1.0 and the other for .NET 2.0.

This is apparently from the Sybase SDK, and Sorry, I can not provide this to you at all. Please contact Sybase!

 

 

 

 

Advertisements

11 thoughts on “Error in Managed .NET Sybase Provider

  1. I met the issue too, When I contacted Sybase, They told me to provide source code ,can you provide test source code?

    1. Hi,

      I encountered this on a customer system, and as such I unfortunately cannot supply any source code.

      However it can be replicated by reading millions of records through the DataReader under multiple processes against Sybase ASE 11.

      (The equivalent operation against SQL Server 2005 SP2 was fine using its ADO.NET driver)

  2. However it can be replicated by reading millions of records through the DataReader under multiple processes against Sybase ASE 11?
    you can replicated the issue everytime?

    1. Yes, the issue happened every time. (The frequency was less with the newer driver)

      I no longer have access to the environment, so I can not provide a test program anymore.

      In addition, I am not able to provide and source because of IP issues and client confidentiality.

      Another solution for you would be to use the ODBC diver instead, which is slower but does not throw exceptions.

  3. I pretty much have a similar issue, but the difference being that I’m using Sybase.AdoNet2.AseClient.dll and version 1.15.356.0. My code has two threads on inserting close to 20 000 records in the database while the other thread is running a select on the count of the records uploaded so far. After a while I get the following error:

    Exception: System.AccessViolationException

    Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

    StackTrace: at Sybase.Data.AseClient.Unmanaged.CloseCommand(IntPtr pConnectionHandle, IntPtr pCommandHandle)
    at Sybase.Data.AseClient1.AseCommand.DisassociateConnection(Boolean connectionClosing)
    at Sybase.Data.AseClient1.AseCommand.Close(Boolean connectionClosing)
    at Sybase.Data.AseClient1.AseCommand.Dispose(Boolean disposing)
    at System.ComponentModel.Component.Dispose()
    at Sybase.Data.AseClient.AseCommand.Dispose(Boolean disposing)
    at System.ComponentModel.Component.Finalize()
    at Sybase.Data.AseClient.AseCommand.Finalize()

    Any ideas?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s