Page 1 of 1

Losing Oracle DB connection

Posted: Wed 09 Jan 2008 14:40
by slokuta
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.

Posted: Wed 09 Jan 2008 16:04
by Alexey.mdr
This error appears if you try to work with the connection that is closed.
What steps did you make?
Is the connection closed?
Are you connecting successfully during 15 minutes?
Could you send us an example?

Still losing Oracle DB connection - Socket error

Posted: Mon 25 Feb 2008 16:29
by slokuta
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

Posted: Mon 25 Feb 2008 16:58
by Alexey.mdr
Try changing your connection string like this:

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" + ";" 
Also try increasing ConnectionTimeout property or setting it to 0.

Posted: Mon 25 Feb 2008 18:08
by slokuta
Thanks for the quick reply. Question however;

Is the syntax Connection Timeout=0 or ConnectionTimeout=0 ?

I found another posting where is was metioned that ConnectionTimeout is not supported in Compact Frame. Is this true or false?

Posted: Wed 27 Feb 2008 14:51
by Alexey.mdr
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?