【问题标题】:Npgsql does not work properly, when using PGPOOL cluster使用 PGPOOL 集群时,npgsql 无法正常工作
【发布时间】:2016-05-17 13:54:43
【问题描述】:

我的问题详情如下,

工作环境

  • Npgsql = 3.0.7
  • 实体框架 = 6.1.3
  • PGPOOL = 3.5.2
  • Postgres = 9.4.8

查询数据库时经常出现以下错误(异常可能因时间和发生地点而异)。

错误 System.IO.EndOfStreamException:试图读取流的末尾。
在 Npgsql.NpgsqlBuffer.Ensure(Int32 计数)
在 Npgsql.NpgsqlConnector.DoReadSingleMessage(DataRowLoadingMode dataRowLoadingMode, Boolean returnNullForAsyncMessage, Boolean isPrependedMessage)
在 Npgsql.NpgsqlConnector.ReadSingleMessage(DataRowLoadingMode dataRowLoadingMode, Boolean returnNullForAsyncMessage)
在 Npgsql.NpgsqlCommand.Execute(CommandBehavior 行为)
在 Npgsql.NpgsqlCommand.ExecuteDbDataReaderInternal(CommandBehavior 行为)
在 Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior 行为)
在 System.Data.Entity.Infrastructure.Interception.InternalDispatcher1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func3 操作,TInterceptionContext 拦截上下文,Action3 executing, Action3 执行)
在 System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand 命令,DbCommandInterceptionContext 拦截上下文)
在 System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand,CommandBehavior 行为)

或:

错误 System.IO.EndOfStreamException:试图读取流的末尾。
在 Npgsql.NpgsqlBuffer.Ensure(Int32 计数)
在 Npgsql.NpgsqlConnector.DoReadSingleMessage(DataRowLoadingMode dataRowLoadingMode, Boolean returnNullForAsyncMessage, Boolean isPrependedMessage)
在 Npgsql.NpgsqlConnector.ReadSingleMessage(DataRowLoadingMode dataRowLoadingMode, Boolean returnNullForAsyncMessage)
在 Npgsql.NpgsqlConnector.ReadExpectingT
在 Npgsql.NpgsqlConnector.ExecuteInternalCommand(FrontendMessage 消息,带超时的布尔值)
在 Npgsql.NpgsqlTransaction.Commit()
在 System.Data.Entity.Infrastructure.Interception.InternalDispatcher1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action2 操作,TInterceptionContext 拦截上下文,Action3 executing, Action3 执行)

同样的查询在没有 pgpool 的情况下运行,不会出现上述异常。

你能建议我解决这个问题吗?

提前谢谢你。

【问题讨论】:

    标签: npgsql


    【解决方案1】:

    这似乎是 https://github.com/npgsql/npgsql/issues/1060 的副本,它已被修复。尝试使用非常新的 3.1.0 看看它是否能解决您的问题(注意,它可能有点原始),或者等到 3.0.8 出来 - 它也将包含修复。

    【讨论】:

    • 您好,非常感谢您的及时回复。对于我们未来的计划,我可以知道何时发布 3.0.8 或兼容 EntityFramework6.Npgsql 的 3.1.0 吗?谢谢。
    • EF6.Npgsql for 3.1.0 将在几天后发布,3.0.8 可能需要几周时间
    • 谢谢。等待下一个 EF6.Npgsql 版本。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-03-16
    • 2018-10-09
    • 2016-07-12
    • 2020-03-21
    • 1970-01-01
    • 1970-01-01
    • 2018-10-29
    相关资源
    最近更新 更多