Exception while reading from stream · Issue #1354 · npgsql/npgsql · GitHub

您所在的位置:网站首页 中考优秀作文游记800字 Exception while reading from stream · Issue #1354 · npgsql/npgsql · GitHub

Exception while reading from stream · Issue #1354 · npgsql/npgsql · GitHub

#Exception while reading from stream · Issue #1354 · npgsql/npgsql · GitHub| 来源: 网络整理| 查看: 265

@treyhard thanks for the added info, I understand what's going on now.

First, a timeout exception is an NpgsqlException and not a PostgresException because it's generated by Npgsql, and not by PostgreSQL. In 3.1, timeouts are implemented as client-side socket timeouts - Npgsql itself gives up on the response, rather than PostgreSQL returning a timeout error (as was the case before 3.0).

The BaseMessage property is obsolete as marked - PostgresException.MessageText should be used instead. However, BaseMessage was left on NpgsqlException for compatibility with Hangfire. Since it internally casts the exception to PostgresException, this will throw an InvalidCastException if the exception is actually an NpgsqlException. This was just a backwards-compatibility compromise, it seems that Hangfire have updated their code so I'll be removing this property in the upcoming Npgsql 3.2.

Long story short - timeouts are a client-side error, so they're not a PostgresException. Avoid BaseMessage in any case.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3