Page 1 of 1

Logging needed

Posted: Mon 27 Jul 2015 07:41
by che1972
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!

Re: Logging needed

Posted: Mon 27 Jul 2015 16:21
by Shalex
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.

Re: Logging needed

Posted: Mon 17 Aug 2015 09:36
by che1972
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?

Re: Logging needed

Posted: Mon 17 Aug 2015 16:37
by Shalex
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