Steven
Steven

Reputation: 13769

Limit Oracle / ASPX Query Time

How can I automatically kill a query that runs for more than 60 seconds?

The queries are called from a VB ASPX page to an Oracle database.

I don't mind putting the limit in the database itself or in the calling aspx code.

FYI: I use a asp:GridView bound to a 'asp:SqlDataSource` for querying the database.

FYI: A connectionString for System.Data.OracleClient does not have a Connection Timeout property (link)

Upvotes: 0

Views: 307

Answers (2)

Gary Myers
Gary Myers

Reputation: 35401

In the database, you can create a PROFILE for a user which will terminate a statement (or session) if it exceeds certain limits. However these are measured in LOGICAL_READS_PER_CALL or CPU_PER_CALL rather than time. Also, bear in mind that for INSERT/UPDATE/DELETE/MERGE, the termination will require any changes done to be rolled back, which can take additional time.

Upvotes: 2

Joel Coehoorn
Joel Coehoorn

Reputation: 415745

Set the CommandTimeout property on the command object in your vb.net code.

Upvotes: 0

Related Questions