Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


ODBC command timeout not working

ODBC command timeout not working

ODBC command timeout not working

I am developing a C# .NET application using Mimer (v 9.2x on both Windows & VMS backends), and the MS ODBC.NET data provider.

When I call ExecuteScalar() on a simple command that has a low timeout, the command completely ignores the timeout, returning only after completion.
eg. command timeout = 5
    command text = "SELECT COUNT(*) FROM hugetable".
  calling ExecuteScalar() may take a seriously long time before returning, and the command timeout has not effect.

Can anyone see my problem, or have any suggestions?

RE: ODBC command timeout not working

This works fine for me.

I am using version v1.1.4322 of the System.Data.dll

Is that what you are using too (or are you maybe using an earlier version of the ODBC Proivder)?

RE: ODBC command timeout not working

We are using v1.1.4322 of the System.Data.DLL.

I've investigated further and found the problem is more specific than I initially wrote..

If I call ExecuteScalar() on a simple commandText of something like "SELECT COUNT(*) FROM hugetable", it usually obeys the command timeout.
However if another connection/process has locked that table by doing an insert/update/delete, then the ExecuteScalar() of the SELECT COUNT does not fail and return after the timeout period, but waits until the locking connection/process ends.

I believe the ExecuteScalar() should exit after the set timeout period under any circumstances.


RE: ODBC command timeout not working

I agree that the timeout should be independent of what is happening in the server.

The behavior you are describing sounds odd considering Mimer does not do any locking. Are you running with a single request thread?

RE: ODBC command timeout not working

There are two execution threads, however the other thread is not blocking the database thread. All database connection/requests are on only one thread, and the other thread is either dormant or doing short term screen gui tasks.

The process that causes the table to be blocked/locked can be running from a different client PC, usually through WSQL or our application/odbc.
The SELECT COUNT.. ExecuteScalar() may not return for 10 or 20 minutes if the process on that table is large.

RE: ODBC command timeout not working

I have been doing some investigation on a similar issue, which might be relevant to your problem. At least, this is the case if you have a problem with the Mimer 9.2 Windows server while the Mimer 9.2 OpenVMS server is working fine.

As far as I can currently see, this problem is because of a flaw in the Microsoft Windows completion port feature. I have an opened case with Microsoft on this issue, but I still await hard facts. Unfortunately, as of now I can't see any workarounds. Hopefully, I will learn more soon.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close