Mobile: A socket operation was attempted to an unreachable host

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
[email protected]
Posts: 6
Joined: Thu 31 Aug 2006 16:36

Mobile: A socket operation was attempted to an unreachable host

Post by [email protected] » Thu 31 Aug 2006 16:40

Hi,
i have a problem with my OraDirect 3.50 Mobile. Wenn my mobile apllication have a long pause (about 10 Minutes), i get the this error(below).
(I close the OraConnection after each DB operation)
Please Help!!!
Thanks a lot!
Eugen

A managed OracleException occured at CoreLab1Oracleab::a+0x21
Network error (A socket operation was attempted to an unreachable host )
CoreLab1Oracleab:a+0x21
DbConnectionInternal::Dispose+0x7
DbConnectionPoolGroup:b+0xb
DbConnectionPool::RemoveObject+0x46
DbConnectionPoolGroup::a+0xa2
DbConnectionPoolGroup::a+0x62
Timer::ring+0x59

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 01 Sep 2006 05:50

Please send us small test project if possible to reproduce the problem; it is
desirable to use 'scott' schema objects, otherwise include definition of
your own database objects. Do not use third party components.
If it is impossible for you to create test project please send us a piece of
your code where the error occurs.
Last edited by Alexey on Mon 27 Nov 2006 08:23, edited 1 time in total.

Eugen

Network error (A socket operation was attempted to an unreachable host )

Post by Eugen » Fri 01 Sep 2006 08:26

Hi Alexey,
I sent an example to you. (on support team address)

Thanks a lot!
Eugen

Eugen

Network error (A socket operation was attempted to an unreachable host )

Post by Eugen » Fri 01 Sep 2006 09:41

Hi Alexey,
Here is detail description of my problem
1. Open OracleConnection
2. Execute query (select * from dual)
3. Close OracleConnection
4. Disconnect the network connection(leave the WLAN) and wait 6-10 Minutes without doing any further action.
5. You will get this exception and the program is dead.
A managed OracleException occured at CoreLab1Oracleab::a+0x21
Network error (A socket operation was attempted to an unreachable host )
CoreLab1Oracleab:a+0x21
DbConnectionInternal::Dispose+0x7
DbConnectionPoolGroup:b+0xb
DbConnectionPool::RemoveObject+0x46
DbConnectionPoolGroup::a+0xa2
DbConnectionPoolGroup::a+0x62
Timer::ring+0x59

My Question:
What is happen by timer wenn my connection is closed? (Timer::ring)

Thanks
Eugen

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 01 Sep 2006 10:18

OK, i will be looking forward to receiving your project.

Eugen

Mobile: Network error wenn Connection is closed

Post by Eugen » Fri 01 Sep 2006 11:08

Alex, you need only this part of code.

private void button1_Click(object sender, System.EventArgs e)
{
//OPEN Connection
OracleConnection oraConnection = new OracleConnection();
oraConnection.UserId = "...";
oraConnection.Password = "...";
oraConnection.Server = "...";
oraConnection.Sid = "...";
oraConnection.Port = 1521;
oraConnection.Open();

//EXECUTE DB Operation
OracleCommand command = new OracleCommand();
command.Connection = oraConnection;
command.CommandText = "select dummy from dual";
OracleDataReader reader = command.ExecuteReader();
if ( (reader != null) && (!reader.IsClosed) )
try
{
if ( reader.Read() )
{string dummy = reader.GetString(0);}
}
finally {reader.Close();}

// CLOSE and dispose Connectionn
oraConnection.Close();
oraConnection.Dispose();
oraConnection = null;

MessageBox.Show("OK \n\nNow the OracleConnection is closed and disposed.\nPlease disconnect the network connection(leave the WLAN) and wait 6-10 Minutes without doing any further actions");
}

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 01 Sep 2006 11:26

Eugen, what we suppose is that you have Pooling=true in your ConnectionString by default, and pool checks itself whether it has spoiled connections inside and tries to delete them from itself. We are going to fix this problem in the next version.

Eugen

Mobile: Network Error wenn Pooling=true

Post by Eugen » Fri 01 Sep 2006 12:01

Thank you Alex,
It's OK now with Pooling=false

Eugen

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 01 Sep 2006 14:22

You are welcome.

Post Reply