sql anywhere AsaConnection_SetMessageCallBack AccessViolationException

Loading...

sql anywhere AsaConnection_SetMessageCallBack AccessViolationException

I have huge problem with sybase sql anywhere 12. If i try to close a connection, i get an AccessViolationException. At the top of the stack trace the following method was called: iAnywhere.Data.SQLAnywhere.PInvokeMethods.AsaConnection_SetMessageCallback(Int32 idConn, SAInfoMessageDelegate msgDelegate)
This is what my console is reporting:

Another problem is, that i do not have a lot of debug options, because this only happens in a customer database and we do not have any debug symbols or development tools, but this are the effected code lines:
public static void ExecuteProcedure(string connectionStringName, string procName, params object[] parameter)
{
    /*if (!connectionString.Contains("con="))
    {
        connectionString = "con=" + procName + ";" + connectionString;
    }*/
    SAConnection con = DAL.ConnectionManager.GetOpenPoolConnection(Connection: connectionStringName);


    StringBuilder cmdbuilder = new StringBuilder();
    cmdbuilder.Append("CALL " + procName);
    cmdbuilder.Append("(");
    AddParameters(cmdbuilder, parameter);
    cmdbuilder.Append(");");

    SACommand cmd = new SACommand(cmdbuilder.ToString(), con);

    foreach (object par in parameter)
    {
        SAParameter parm = new SAParameter();
        if (par != null)
        {
            parm.Value = par; 

        }
        else
        {
            parm.Value = DBNull.Value;
        }
        cmd.Parameters.Add(parm);
    } 

    try
    {
        IDataReader dr = cmd.ExecuteReader();
        if (dr != null)
        {
            dr.Close();
        }
    }
    catch (Exception ex)
    {
        if (con != null)
        {
            con.Close();
        }

        throw new Exception("Fehler in ExecuteProcedure", ex);
    }
    finally
    {
        if (con != null)
        {
            con.Close();
        }
    }
}

It's a very old method which must be rewritten, but currently we have to use it...
EDIT
The problem seems to be solved with a newer sybase dll, see SQL Anywhere Bug Fix Readme for Version 12.0.1, build 4224. I will proof this an report.
Thank you very much...

Solutions/Answers:

References

Loading...