Sorry I didn’t reply this weekend, this is for work, which I don’t too do much of over the weekend. LLBLGen is setting the value properly, but the timeout never occurs (and values such as 1 or 2 are valid and work in other scenarios).
This appears to be an issue with the Oracle Provider (sort of, the fix is a server side setting…).
The only scenario where this arises is on long running stored procedures when you want to use the CommandTimeout parameter.
My testing yesterday found that the CommandTimeout works fine for regular queries, but it fails for stored procedure calls (no matter how long they run and regardless of the CommandTimeout value).
Finally, Oracle acknowledges the problem. The recommended “fix” is a server side change, one that I am in no position of having changed (the system where the stored procs. reside is a system we are integrating with).
From the Readme for ODP.Net 10.1.0.3.01 (the version I have is 10.1.0.4 – but it certainly still has this problem):
-
Terminating the execution of a PL/SQL stored procedure or function may not
acknowledge the invocation of OracleCommand's Cancel method or expiration
of OracleCommand's CommandTimeout property value in a timely manner.
For better responsiveness, the init.ora parameter can be modified to have
BREAK_POLL_SKIP=3. However, this change can degrade the overall performance
of normal SQL and PL/SQL execution by up to about 5%.
[bug 3715843]
http://www.oracle.com/technology/docs/tech/windows/odpnet/readme10103.txt
Init.ora is a server side configuration file (the primary one I believe).
Possible Resolution with Discussion:
This issue only arises on Retrieval Procedures. The Action Procedures are fast, and due to security restrictions, I have no other choice but to use the SPs for their functionality. But, I do have the appropriate SELECT grants to allow for flexibility in the Retrieval Procedure calls.
As well, this is a situation that doesn’t lend itself to Entities as I have two or three different providers for this object type, and not all are databases (one is a Java backend that I only have HTTP web service access to). So I’m using a GenericInsured object which the various ServiceAgent classes know how to populate (the remainder of the backend just uses GenericInsured, regardless of the actual source).
And, I need to be able to control:
1. Execution time, specifically catching and handling when queries go longer than expected.
2. Result count returned (implemented like this in the SQL: “AND rownum <= inMaxRecordCount”)
Because I need that level of control, and this type of data isn’t really suited for Entity objects, I’m considering just writing my code data access code to perform these queries. As queries I get all of the control I need.
If this data was suited to Entities then that’s certainly the route I would take, but due to the custom providers for the same type of data it’s easier to implement a simple generic object.