I had a situation yesterday that I didn't expect and therefore didn't
handle correctly. My code is executing a Stored Procedure on an Oracle
DB using the performGenericQuery method. The problem was that the
Oracle server was not responding to the stored procedure and the
eventually the query returned "successfully" with an empty result. I
was expecting some sort of exception to be thrown (like a timeout) in
this situation but it definitely was not the case. I currently measure
the transaction time and the empty response was returning consistently
at 60 seconds - it normally takes less than 2 seconds. I am not sure if
this 60 second timeout is set on the Oracle server or somewhere in the
Cayenne connection.
I have three questions:
1) Is there a way to set a timeout value within the Cayenne connection,
or better yet, an individual query to force a timeout exception if a
response is not received within a certain period of time?
2) Assuming the timeout is triggered from the Oracle server for the
situation I describe above, other than examining the timeout value
within my code, is there a way to differentiate between a successful
transaction and one where the DB server times out and returns an empty
result set?
3) Assuming that the answer is "no" to both questions 1 & 2, is there a
way to "kill" a query in order to release the DB connection and return
it to the pool?
I am using V3.0.2.
Thanks,
Andrew