Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

CommandTimeout doesn't happen with ODP.NET 10.1.0.4.0

448873Aug 2 2005 — edited Feb 8 2012
Hi, Guys.
I have a problem. I'm using ODP.NET 10.1.0.4.0, and trying to generate an exception by CommandTimeout. I set CommandTimeout 1 second and executed a query that takes a few minutes. But nothing happend.
I know that MS's System.Data.OracleClient doesn't support CommandTimeout but ODP.Net does from 10.1.0.3.01.

Is there anyone who can solve this problem?

Here is a code.

OracleConnection conn = new OracleConnection("Data Source=foo;user id=foo;password=bar");
OracleCommand cmd = conn.CreateCommand();
cmd.CommandTimeout = 1;
cmd.CommandText="SELECT foo FROM baz_tbl WHERE hoge = 'ZZZ'";
OracleDataAdapter adapt = new OracleDataAdapter(cmd);
DataSet ds = new DataSet();

try {
Console.WriteLine(DateTime.Now.ToString());
adapt.Fill(ds);
Console.WriteLine(DateTime.Now.ToString());
} catch (Exception ex) {
Console.WriteLine("Exception: " + ex.Message);
Console.WriteLine(DateTime.Now.ToString());
}

--------------------
and output was just bellow
2005/08/02 16:12:50
2005/08/02 16:13:48
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 7 2012
Added on Aug 2 2005
8 comments
12,787 views