ThinkGeo.com    |     Documentation    |     Premium Support

PostgreSQLFeatureLayer causes Log error in database Log file

Hi,


I have a PosgreSQLFeatureLayer, when it loads data from the database, or when the map is zoomed in/out, it causes some errors in the database Log file:


could not receive data from client:Unknown winsock error 10061


Unexpected EOF on client connection


I did not notice this before. By the way, I am using Windows Vista x64.


Thanks


Rose


 



Rose,


Thanks for your post!
 
This error may be some shared memory issue of the Postgre, and I found that some people have fixed this issue and produced a patch file. You can find the detail information in the following links:
 
archives.postgresql.org/pgsq...g00036.php
 
Or
 
nabble.com/Unknown-winso...53660.html
 
And you can get the patch file here:
 
uploads.enterprisedb.com/dow...35bdb665ee
 
Any more questions please let me know.
 
Thanks,
 
Sun

Sun:


The link you mentioned to get the patch file is for EnterpriseDB Large File Uploader, I don't think that is the patch file for the issue I mentioned. Also I am still using PosgreSQL 8.3, everything worked well before I upgraded to MapSuite 3.1.182.


Thanks


Rose


 


 



Rose,


I am wondering which product you are using, MapSuite Service Edition or MapSuite Desktop Edition? 


And can you specify the versions in more detail which version you are upgraded from? And which version is now you are using (if you are using Desktop Edition, you have to let us know which version for Desktop too)?


Sorry for the inconvenience.


Any more questions let me know.


Thanks.


Sun



Sun:


I am using MapSuite Desktop 3.0.362 RC, PostgreSQL 8.3.


Thanks


Rose



Hi Rose,


We have recreated this error and found that this is really a bug in postgre extension of the latest public release version (3.0.362). This problem has been fixed and it will not exist in the next version.
 
Thank you for reporting this problem, and any more questions please let me know.
 
sun

Sun:


Can I get the intrim build with the bug fixed? I can't wait until next release, my project has been overdue.


Thanks


Rose



Rose, 
  
 We will try to send you a temporary version as soon as possible (3.0.382). 
  
 Any more questions just let us know. 
  
 Thanks. 
  
 Yale 


Hi,


With the build of 3.0.382, I still can see the same errors in the Database Log file when the Npgsql.NpgsqlConnection is closed.


 


Thanks


Rose


 



Hi Rose,


Do you create and close the Npgsql.NpgsqlConnection manually like this? 
 


NpgsqlConnection connection = new NpgsqlConnection(connectString);
postgreLayer = new PostgreSqlFeatureLayer(connection, "rail", "oid");


 
Could you please supply some sample code here so that I can recreate this error in my machine? I can not see this error log message until my application is closed.
 
Thanks,
 
sun

Hi, Sun:


Here is the code snippet, you don't need to load the map, just create the connection and close it


When the form is loaded: 


dbconn = New Npgsql.NpgsqlConnection(connectString) 


When the form is closed: 


dbconn.close 



Rose,


This log message is generated because Npgsql is using pool. When your application finishes, .NET shuts down the TCP connections and postgresql logs that.
 
I think this is harmless, and you can get ride of this message by turning off the connection pool with pooling=false in your connection string. So the connection string could be like this:
 


string connectString = "Server=192.168.0.210;User Id=yourid;Password=password;DataBase=postgis;pooling=false;";


 
Or you can clear the connection pool manually when your application finishes. For example, you can do this in the FormClosing event:
 


void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
    connection.ClearPool();
}


 
And you can get more information about this here:
pgfoundry.org/forum/forum.ph...rum_id=519
 
and here:
pgfoundry.org/forum/forum.ph...rum_id=519
 
Hope this can help you, and any more questions please let me know.
 
Thanks,
 
sun