Problem when create a new Postgre-connection

Problem when create a new Postgre-connection

Postby LarsGr » Wed 04 Aug 2010 12:26

I have installed your current release of dotConnect for PostgreSQL (4.95.152 (28-Jul-2010)) and on my system runs the PostGre-Version 8.4.4.

The problem is, even if I try to create a new connection (in visual studio or in the Entity Developer) with the wizard, a connection time out message occurs. I have configured the timeout in the advanced configuration view to 60 seconds and more but I can't create the connection ...

Other tools like pgAdmin or with ODBC can connect to the server. What can I do to solve the problem?

Best regards
Lars
LarsGr
 
Posts: 5
Joined: Wed 04 Aug 2010 12:15

Postby StanislavK » Wed 04 Aug 2010 17:35

Speaking about the wizard, do you mean Reverse Engineering Wizard for creating model from database? Please try opening the connection in Visual Studio Server Explorer; can the problem be reproduced in this case?

Also, please specify (at least roughly) the connection properties you are setting. At the moment, we couldn't reproduce the problem in our environment.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Problem when create a new Postgre-connection

Postby LarsGr » Wed 04 Aug 2010 17:52

Hi,

yes, in Visual Studio's Server Explorer has the same behaviour. The connection parameters I've changed, are

Host => localhost
User => postgres
Passw => admin
Database => TestDB

With these parameters, I can connect via ODBC, in the pgAdmin and also in a Python-Script.
With the Connection Wizard always a "timeout" message occurs. It is possible, that I must change other parameters, like protocol ?

Best regards
Lars
LarsGr
 
Posts: 5
Joined: Wed 04 Aug 2010 12:15

Postby StanislavK » Thu 05 Aug 2010 12:37

Could you please specify the encryption method (MD5 or other) used on your PostgreSQL server (you can see it in the pg_hba.conf file in the Data subdirectory of the folder where PostgreSQL is installed)?

Also, please try opening this connection at run-time using the PgSqlConnection component:
Code: Select all
PgSqlConnection conn = new PgSqlConnection
   ("Host = localhost; User Id = postgres; Password = admin; Database = TestDB;");
conn.Open();

Please specify the exact error message you are receiving and the exception stack trace.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Problem when create a new Postgre-connection

Postby LarsGr » Thu 05 Aug 2010 18:14

In the file is

# TYPE DATABASE USER CIDR-ADDRESS METHOD

# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
#host all all ::1/128 md5

but, after some restarts of my computer and after I've configured the character set to UTF8 and Unicode to True, the connection was more stable. I have no idea what is was, but now it seems to be good.

Note:
In the ASP application, the connection works fine. The problem is/was only in the design mode in Visual Studio, if I want to read the database entities to build the queries and so on.

best regards
Lars
LarsGr
 
Posts: 5
Joined: Wed 04 Aug 2010 12:15

Problem when create a new Postgre-connection

Postby LarsGr » Fri 06 Aug 2010 10:18

Hi,

now my last experiences with the "Create new connection"-dialog in Visual Studio 2008 (SP1):

2010-08-06 11:07:50 CEST LOG: could not receive data from Client: No connection could be made because the target machine actively refused it.

2010-08-06 11:07:50 CEST LOG: incomplete start-package

In my opinion, the generated connection string is not correct. Some times if I change some properties and restore it, the connection works.

The postgres-server is installed with german localization. Other tools can connect.

While I'm writing this message, the connection was established without further changes. It's crazy.

best regards
Lars
LarsGr
 
Posts: 5
Joined: Wed 04 Aug 2010 12:15

Postby StanislavK » Fri 06 Aug 2010 16:50

The issue may be caused by the following reasons:

1. Connection pooling problems. The issue may occur if dotConnect for PostgreSQL experiences problems with placing connections to the pool or retrieving them back. To check if this is the case, please try setting the Pooling connection string parameter to false (it is true by default).

2. Firewall issues. Provided that the connection works properly at run-time but not at design-time, the problem may be caused by invalid configuration of the firewall. Please try disabling it and check whether you are able to connect reliably.

Please check these options and notify us about the results.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Problem when create a new Postgre-connection

Postby LarsGr » Fri 06 Aug 2010 18:20

Hi,

yes, the first tip could be the solution. I've changed some entries on the advanced page, and, if I remember correctly, also the pooling-parameter to false.

Is this a configuration problem of the postgres server? Should I configure something to support these settings?

The firewall should be configured correctly.

thanks and best regards
Lars
LarsGr
 
Posts: 5
Joined: Wed 04 Aug 2010 12:15

Postby StanislavK » Mon 09 Aug 2010 14:05

Most probably, there are some problems with the server configuration that make the connection unstable. When pooling is enabled, an invalid connection can be used several times, and after connecting for the first time it fails to be opened. When pooling is disabled, a connection is disposed after it was used.

Please try connecting to some other PostgreSQL server (for example, install another local server) and tell us about the results.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48


Return to dotConnect for PostgreSQL