Updated to 5.10.111, now connection closes

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
Posts: 9
Joined: Wed 05 May 2010 16:30

Updated to 5.10.111, now connection closes

Post by Nieuwsma » Wed 02 Mar 2011 19:53

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?



Site Admin
Posts: 8248
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 03 Mar 2011 16:18

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.)?

Posts: 9
Joined: Wed 05 May 2010 16:30

back to older version, now fails to create data context

Post by Nieuwsma » Fri 04 Mar 2011 00:00

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.


Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Fri 04 Mar 2011 18:11

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.

Post Reply