【问题标题】:iAnywhere.Data.SQLAnywhere.SAException Connection error: Connection was dropped (may not be a SQL Anywhere server)iAnywhere.Data.SQLAnywhere.SAException 连接错误:连接已断开(可能不是 SQL Anywhere 服务器)
【发布时间】:2021-04-23 18:03:17
【问题描述】:

尝试从 Azure ServiceFabric 连接到 SQLAnywhere (Sybase) 数据库(C# 代码)时:

await using var connection = new SAConnection(connectionString);
await connection.OpenAsync();

收到 iAnywhere.Data.SQLAnywhere.SAException

Connection error: Connection was dropped (may not be a SQL Anywhere server)

错误代码是错误 832。This is generic connection error:An error occurred while attempting to establish a connection with the database server, but before attempting to connect to a database. Failure to initialize a communication link during the connection attempt is an example of this error. Creating a debug log file using the LogFile connection parameter may provide more information.

在本地它可以工作,但在 Service Fabric 中不起作用。

已尝试修复想法:

  1. 缺少驱动程序?看起来没有,Sybase(现在是 SAP)SQLAnywhere 需要特殊的驱动程序或客户端 - 但在本地也可以在没有此驱动程序的情况下工作,只需安装 iAnywhere.Data.SQLAnywhere.NETCore nupackage
  2. 网络连接/防火墙问题?好像没有,可以从 Service Fabric 节点 ping 数据库服务器

【问题讨论】:

    标签: .net-core sybase azure-service-fabric sqlanywhere


    【解决方案1】:

    这是另一种流量保护工具。虽然可以 telnet 端口,但来自应用程序的流量仍然被另一个工具阻止。

    【讨论】:

    • 另一个大问题是 - 这个包的新 .net 核心版本速度慢。事实证明,它不能很好地处理传出参数 - 参数的定义大小实际上会被发送出去:``` var yourOutParameter = new SAParameter("@OutMsg", SADbType.Binary) { Direction = ParameterDirection.Output, Size = 256000000, IsNullable = true }; ``` 所以检查你的响应的实际消息大小是多少,可能 1 兆字节甚至千字节就足够了,并相应地设置大小参数。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-24
    • 1970-01-01
    • 1970-01-01
    • 2010-12-07
    相关资源
    最近更新 更多