Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Npgsql 1.0.0.0

Status
Not open for further replies.

ZdenekMach

Programmer
Joined
Dec 19, 2006
Messages
7
Location
CZ
Hi all, could you please help me?
I am doing program in C# and my WebService could not access the Postgre Database. I hade just one another program which used Npgsql version 7.0.0 and now I have 1.0.0.0 and dont know why it cant work. The method NpgsqlConnection.Open() doesnt work.
I gave following exception:

System.Exception: Error by inserting new record into 'DeliveryInfo' log table. ---> Npgsql.NpgsqlException: The attempted operation is not supported for the type of object referenced ---> System.Net.Sockets.SocketException: The attempted operation is not supported for the type of object referenced
at System.Net.Sockets.Socket.get_ConnectEx()
at System.Net.Sockets.Socket.BeginConnectEx(EndPoint remoteEP, Boolean flowContext, AsyncCallback callback, Object state)
at System.Net.Sockets.Socket.BeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state)
at Npgsql.NpgsqlClosedState.Open(NpgsqlConnector context)
--- End of inner exception stack trace ---
at Npgsql.NpgsqlClosedState.Open(NpgsqlConnector context)
at Npgsql.NpgsqlConnector.Open()
at Npgsql.NpgsqlConnectorPool.GetPooledConnector(NpgsqlConnection Connection)
at Npgsql.NpgsqlConnectorPool.RequestPooledConnectorInternal(NpgsqlConnection Connection)
at Npgsql.NpgsqlConnectorPool.RequestPooledConnector(NpgsqlConnection Connection)
at Npgsql.NpgsqlConnectorPool.RequestConnector(NpgsqlConnection Connection)
at Npgsql.NpgsqlConnection.Open()
at Elx.Architecture.Database.Client.Sql.Postgres.Common.PostgresServerAccess.Open() in C:\Dev\Src\Elx\Architecture\Database\Client\SQL\Postgres\Common\PostgresServerAccess.cs:line 255
at Elx.Architecture.Database.Client.Sql.Postgres.Common.PostgresServerAccess.CreateCommand(String sProcName, NpgsqlParameter[] collInputParams) in C:\Dev\Src\Elx\Architecture\Database\Client\SQL\Postgres\Common\PostgresServerAccess.cs:line 219
at Elx.Architecture.Database.Client.Sql.Postgres.Common.PostgresServerAccess.RunCommonProcedure(String sProcName, NpgsqlParameter[] collParams) in C:\Dev\Src\Elx\Architecture\Database\Client\SQL\Postgres\Common\PostgresServerAccess.cs:line 85
at ServiceProcess.insertDeliveryInfo(String sEmlFileName, String sAttachmentFileName, String sEmailAddress, Int64 lMessageId, EmlGeneratorAppSource emlGeneratorAppSource, Int32 nCustomerId) in c:\Dev\Src\Elx\Apps\CitibankEAS\Services\WebServiceHost\EDAS\App_Code\ServiceProcess.cs:line 306
--- End of inner exception stack trace ---
at ServiceProcess.insertDeliveryInfo(String sEmlFileName, String sAttachmentFileName, String sEmailAddress, Int64 lMessageId, EmlGeneratorAppSource emlGeneratorAppSource, Int32 nCustomerId) in c:\Dev\Src\Elx\Apps\CitibankEAS\Services\WebServiceHost\EDAS\App_Code\ServiceProcess.cs:line 310
at ServiceProcess.InsertDeliveryInfo(String sEmlFileName, String sAttachmentFileName, String sEmailAddress, Int64 lMessageId, EmlGeneratorAppSource emlGeneratorAppSource, Int32 nCustomerId) in c:\Dev\Src\Elx\Apps\CitibankEAS\Services\WebServiceHost\EDAS\App_Code\ServiceProcess.cs:line 58
at edsWsEmailService.InsertDeliveryInfo(String sEmlFileName, String sAttachmentFileName, String sEmailAddress, Int64 lMessageId, EmlGeneratorAppSource emlGeneratorAppSource, Int32 nCustomerId) in c:\Dev\Src\Elx\Apps\CitibankEAS\Services\WebServiceHost\EDAS\App_Code\edsWsEmailService.cs:line 29


Could you please help me.Zdenek.
 
Hello --

I have had the same problem with the same version of npgsql. It appears to be a problem with asynchronous sockets in ASP.NET. The error stems from BeginConnect on the underlying TCP socket connected to the Postgresql DB. The same exact code works fine under Windows Forms.

I downgraded to 0.7.0.0 and it works.

Some friends of mine could not recreate the error - I believe it can be solved by configuring machine.config or something. I tried changing the user running asp.net, tried running it under administrator privileges, and nothing changed.

If anyone has any thoughts, I'd be very appreciative.

Thank you all,
-Eli
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top