Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is Oracle's JDBC query timeout implemented?

Tags:

I was curious as to how the Oralce JDBC thin client implement query timeout. This can be set by calling java.sql.Statement's setQueryTimeout(int seconds) method.

Is this implemented in the driver itself on the client side? Is a new thread spawned and joined? Or does the JDBC driver simply send a parameter to Oracle, and then it enforces the timeout?

After the timeout is reached, which resources on the client and database are released, and which hang around? Does Oracle continue to run the query even though the client abandoned it or is it terminated? Is there still a cursor object on the client side?

Thank you

like image 597
oneself Avatar asked Mar 04 '10 03:03

oneself


1 Answers

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.

like image 102
Janek Bogucki Avatar answered Sep 18 '22 09:09

Janek Bogucki