[ACCEPTED]-How is Oracle's JDBC query timeout implemented?-timeout

Accepted answer
Score: 15

According to Oracle JDBC FAQ

Statement timeout thread. This thread is created if you execute any statement with a timeout. Only one thread is created no matter how many statements or connections. This thread lasts the lifetime of the VM.


Score: 12

Tanel Poder wrote an article on how a Cancel works 5 through the OCI (Oracle Call Interface). I 4 guess something similar is done for JDBC. If 3 you are using the thick driver, through 2 OCI, you could try tracing the session (through 1 settings sqlnet.ora) and see what gets recorded.

Score: 3

When a query actually timesout when using 6 the setTimeOut method, a SQL exception with 5 the Oracle error code ORA-01013 - user requested cancel of current operation is thrown from the 4 oracle server.

This would mean that the operation 3 has been cancelled gracefully (as far as oracle is 2 concerned/as much oracle can) - because 1 it is oracle sending this message.

Score: 1

I do know that the query does not continue 7 on the server side when the timeout is reached. There 6 is some intention/signal option sent to 5 the server either before or after the timeout 4 is reached to indicate it the server should 3 stop. I have verified this by looking on 2 the server in various V$ tables to see if 1 the query is running. (V$SESSION, V$SQL, etc)

More Related questions