Page 1 of 1

Updated to 5.10.111, now connection closes

Posted: Wed 02 Mar 2011 19:53
by Nieuwsma
I updated to dotConnect 5.10.111 from 4.95.146 and now code that was fine is breaking because the connection has closed. I keep a db connection open in a Windows Service. Now, a few seconds after opening, it is closed. My code is not closing it until the service is stopped.

What has changed? Does the lates version require that we always check the connection state and re-open if state is closed?

Thanks!

David

Posted: Thu 03 Mar 2011 16:18
by Shalex
I cannot reproduce the described problem with dotConnect for PostgreSQL v 5.10.111.
Please send us the following:
1) the exact text of the error message and your call stack;
2) the exact version of your PostgreSQL server;
3) a small test project with the corresponding DDL/DML script to reproduce the issue in our environment, also tell us your connection string settings (without credentials);
4) are there any specific settings at your PostgreSQL server which can result in closing connection (max_connections, statement_timeout, etc.)?

back to older version, now fails to create data context

Posted: Fri 04 Mar 2011 00:00
by Nieuwsma
I sent you more information, per the link you supplied.

So, today I uninstalled the new version and re-installed version 4.95.146. Now I cannot create the data context. Call to connection.Open() seems to work, but trying to get the data context fails. Exception:
{"Invalid connection type. Expected Type: Devart.Data.PostgreSql.PgSqlConnection, Actual Type: Devart.Data.PostgreSql.PgSqlConnection"}

Please advise how to get back to where I was so I'm not stuck.

Thanks!

Posted: Fri 04 Mar 2011 18:11
by StanislavK
Could you please describe the situation in more details? For example, please specify the following:
- how exactly you are creating the DataContext instance;
- whether you are using the same connection object for this DataContext;
- whether you are explicitly opening a transaction for this connection.

As for the 'Invalid connection type' error, it is most probably caused by using invalid versions (e.g., the ones from the newer build) of Devart assemblies. To resolve it, please try performing the following:
- uninstall dotConnect for PostgreSQL;
- clear the "Program Files\Devart\dotConnect\" and "Program Files\Common Files\Devart\" folders;
- remove all Devart.* and policy.*.Devart.* assemblies from the GAC;
- clear the Bin folder of your application;
- re-install dotConnect for PostgreSQL 4.95.146;
- re-build the application.

Please tell us if this helps.