We are using Core Lab OraDirect .NET Mobile version 4.35 for .NET CF 2.0
After about 10-15 minutes, we try to access Oracle DB and receive the following:
Network error: An operation was attempted on something that is not a socket
I have read other postings regarding this issue and tried various suggested solutions, but nothing seems to work for us.
We plan on going "live" next week and need a solution.
Losing Oracle DB connection
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
Still losing Oracle DB connection - Socket error
Still losing Oracle DB connection after 15 minutes. Receiving the following error:
CoreLab.Oracle.OracleException was unhandled
ErrorCode=-2147483648
Message="Network error:: A socket operation was attempted to an unreachable host"
StackTrace:
at CoreLab.Oracle.i.ad()
at CoreLab.Oracle.u.c()
at CoreLab.Oracle.aw..ctor()
at CoreLab.Oracle.ad.e()
at CoreLab.Common.DbConnectionFactory.k()
at CoreLab.Common.DbConnectionPoolGroup.i()
at CoreLab.Common.DbConnectionPool.a()
at CoreLab.Common.DbConnectionPool.GetObject()
at CoreLab.Common.DbConnectionFactory.j()
at CoreLab.Common.DbConnectionClosed.Open()
at CoreLab.Common.DbConnectionBase.Open()
at CoreLab.Oracle.OracleConnection.Open()
at mobile1.form1.btnOK_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Button.OnClick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at mobile1.form1.Main()
Here is my code:
OracleConnection1.ConnectionString = "User Id=" + UserID.Text + ";Password=" + _
Password.Text + ";Server=172.27.4.203;SID=PHOBOS;Pooling=false;Connection Timeout=5000;Max Pool Size=1000" + ";"
Public Class cycle_count
Private oraerrno As Integer
Private oraerrmsg As String
Dim cmd As New OracleCommand()
Public Sub get_cycle_cnt()
OraLogon.OracleConnection1.Open()
cmd.Connection = OraLogon.OracleConnection1
Try
......
......
......
End Try
OraLogon.OracleConnection1.Close()
End Class
CoreLab.Oracle.OracleException was unhandled
ErrorCode=-2147483648
Message="Network error:: A socket operation was attempted to an unreachable host"
StackTrace:
at CoreLab.Oracle.i.ad()
at CoreLab.Oracle.u.c()
at CoreLab.Oracle.aw..ctor()
at CoreLab.Oracle.ad.e()
at CoreLab.Common.DbConnectionFactory.k()
at CoreLab.Common.DbConnectionPoolGroup.i()
at CoreLab.Common.DbConnectionPool.a()
at CoreLab.Common.DbConnectionPool.GetObject()
at CoreLab.Common.DbConnectionFactory.j()
at CoreLab.Common.DbConnectionClosed.Open()
at CoreLab.Common.DbConnectionBase.Open()
at CoreLab.Oracle.OracleConnection.Open()
at mobile1.form1.btnOK_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Button.OnClick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at mobile1.form1.Main()
Here is my code:
OracleConnection1.ConnectionString = "User Id=" + UserID.Text + ";Password=" + _
Password.Text + ";Server=172.27.4.203;SID=PHOBOS;Pooling=false;Connection Timeout=5000;Max Pool Size=1000" + ";"
Public Class cycle_count
Private oraerrno As Integer
Private oraerrmsg As String
Dim cmd As New OracleCommand()
Public Sub get_cycle_cnt()
OraLogon.OracleConnection1.Open()
cmd.Connection = OraLogon.OracleConnection1
Try
......
......
......
End Try
OraLogon.OracleConnection1.Close()
End Class
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
Try changing your connection string like this:
Also try increasing ConnectionTimeout property or setting it to 0.
Code: Select all
OracleConnection1.ConnectionString = "User Id=" + UserID.Text + ";Password=" + _
Password.Text + ";Server=172.27.4.203;SID=PHOBOS;Pooling=true;Connection Timeout=5000;Max Pool Size=1000" + ";"
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
Connection Timeout=0 is correct.
Yes, as you have noticed this property is not taken in account in Compact Framework 2.0.
It's set to default (which is 0).
Could you please describe more precisely the steps that led to the exception?
Do you use the same connection string when you click on the button (from the stack trace)?
What's happening in the 15 minutes timespan?
Are you able to connect and manipulate data on the server in this timespan?
Yes, as you have noticed this property is not taken in account in Compact Framework 2.0.
It's set to default (which is 0).
Could you please describe more precisely the steps that led to the exception?
Do you use the same connection string when you click on the button (from the stack trace)?
What's happening in the 15 minutes timespan?
Are you able to connect and manipulate data on the server in this timespan?