Page 1 of 1

OracleConnection for Windows Mobile

Posted: Tue 25 May 2010 12:48
by StealthOMS
I have project on C# on VS2008. When i try to open connection to oracle from static constructor of static class i have Exception "Server did not respond within the specified timeout interval". Whan I do this from static member of static class all work fine. How can I open connection to oracle from static constructor of static class?

This code raice exception:
static class ERPDB
{
static int a;
public static void tst()
{
a = 1;
}

static ERPDB()
{
string myConnectionString = "User Id=S;Password=s;Data Source=10.1.1.1;SID=TT";
OracleConnection myConn = new OracleConnection(myConnectionString);

myConn.Open();
}
}

I call ERPDB.tst();

This code work fine:
static class ERPDB
{
static int a;
public static void tst()
{
a = 1;
string myConnectionString = "User Id=S;Password=s;Data Source=10.1.1.1;SID=TT";
OracleConnection myConn = new OracleConnection(myConnectionString);

myConn.Open();
}

static ERPDB()
{
}
}

I call ERPDB.tst();

Posted: Wed 26 May 2010 16:58
by StanislavK
We've reproduced the problem. We will investigate it and notify you about the results.

Posted: Thu 03 Jun 2010 16:28
by StanislavK
We've investigated the problem. A possible workaround is to set the Connection Timeout property to 0. The problem itself is a peculiarity of .NET Compact Framework.