Can't immediately receive multiple notifications in Npgsql

本小妞迷上赌 提交于 2019-11-30 16:20:13

Unless your client library supports checking the network socket for buffered data, the only way to receive notifications is to trigger some other activity on the socket.

Many applications periodically send an empty query string ("") to do this.

If the client library supports it and you are not using SSL, it might be possible to periodically call some kind of checkForNotifications() function on the connection. This is possible in PgJDBC, but I don't know nPgSQL, so I can only advise you to check out the documentation for that.

UPDATE (2015-02-27): This bug is already fixed in our master branch on github. Note that master branch is our upcoming 3.0 version and may have some bugs we are working on. Please, give it a try and let me know if it works for you.

This is a bug in Npgsql. We are working to fix it. Check this pull request for more info about it: https://github.com/franciscojunior/Npgsql2/pull/46 in special the commit: https://github.com/glenebob/Npgsql2/commit/98fd469048a20119755777ce3a8ffc4397f4a114

But we are trying another approaches in order to fix this problem. Note that this problem only occurs when you send multiple notifications in a very short period. If you keep a space of 1 or 2 seconds between notifications, they are delivered correctly.

As soon as we get it fixed I'll update my answer here.

Sorry for all the inconvenience this problem may have caused.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!