Logging needed

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
che1972
Posts: 8
Joined: Thu 04 Sep 2014 12:02

Logging needed

Post by che1972 » Mon 27 Jul 2015 07:41

Hi,

sometimes I get the following connection problem with the server:

Unexpected server response.
Inner Stack Trace ###
bei Devart.Data.PostgreSql.ai.a(Char A_0, Boolean A_1, Boolean A_2)
bei Devart.Data.PostgreSql.ae.a(Char A_0, Boolean A_1, Boolean A_2)
bei Devart.Data.PostgreSql.ai.a(Boolean A_0, Boolean A_1, Char A_2, Boolean A_3)
bei Devart.Data.PostgreSql.ae.b(Boolean A_0)
bei Devart.Data.PostgreSql.ae.g(ac A_0)
bei Devart.Data.PostgreSql.ae.f(ac A_0)
bei Devart.Data.PostgreSql.ac.n()
bei Devart.Data.PostgreSql.

Is it possible to get more information about the error? Is there a way to see or enable a more detailled logging?
I know that this is a very common question and first I looked in the "FAQ" topic. But the link there (http://crlab.com/pgsqlnet/faq.html) seems to be broken.

Thanks in advance!

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Logging needed

Post by Shalex » Mon 27 Jul 2015 16:21

1. There were several fixes related to the "Unexpected server response" error in the previous versions of dotConnect for PostgreSQL: https://www.devart.com/dotconnect/postg ... story.html. Have you tried using the latest (7.3.457) build?
che1972 wrote:Is it possible to get more information about the error? Is there a way to see or enable a more detailled logging?
2. Please enable the dbMonitor tool to find out what database event leads to the error.

che1972
Posts: 8
Joined: Thu 04 Sep 2014 12:02

Re: Logging needed

Post by che1972 » Mon 17 Aug 2015 09:36

I found out that the environment is the problem. Our application is started by "clickonce" in a citrix environment. When there are several users working at the same time, a connection can be lost randomly. In this case a new connection will be opened. Unfortunately when the application is inside a transaction, all data is lost. So what can I do? Is it possible to store a transaction on the server and then access it by a different (new) connection? Or is there a solution a didn't think about?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Logging needed

Post by Shalex » Mon 17 Aug 2015 16:37

che1972 wrote:When there are several users working at the same time, a connection can be lost randomly.
The PgSqlConnection instance is not guaranteed to be thread safe. You should avoid using the same PgSqlConnection in several threads at the same time. It is recommended to open a new connection per thread and to close it when the work is done.
che1972 wrote:Unfortunately when the application is inside a transaction, all data is lost. So what can I do?
1. A transaction must succeed or fail as a complete unit. Why are you using transaction if you do not want to roll back the previous operations (submitted before the fail)?
2. The interface of the PgSqlTransaction class is not designed for this approach.
3. You can try to implemented the desired approach via SQL statements (executed via PgSqlCommand):
http://www.postgresql.org/docs/9.4/stat ... ction.html
http://www.postgresql.org/docs/9.4/stat ... ction.html

Post Reply