Page 1 of 1

Mobile: A socket operation was attempted to an unreachable host

Posted: 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

Posted: Fri 01 Sep 2006 05:50
by Alexey
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.

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

Posted: Fri 01 Sep 2006 08:26
by Eugen
Hi Alexey,
I sent an example to you. (on support team address)

Thanks a lot!
Eugen

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

Posted: Fri 01 Sep 2006 09:41
by Eugen
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

Posted: Fri 01 Sep 2006 10:18
by Alexey
OK, i will be looking forward to receiving your project.

Mobile: Network error wenn Connection is closed

Posted: Fri 01 Sep 2006 11:08
by Eugen
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");
}

Posted: Fri 01 Sep 2006 11:26
by Alexey
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.

Mobile: Network Error wenn Pooling=true

Posted: Fri 01 Sep 2006 12:01
by Eugen
Thank you Alex,
It's OK now with Pooling=false

Eugen

Posted: Fri 01 Sep 2006 14:22
by Alexey
You are welcome.