Rig Veda Rig Veda - 1 year ago 111
Java Question

executeQuery() not returning

Is there any condition under which the following statement


does not return or throw an exception?

Answer Source

It depends on the database you're using and the configured isolation level. A common default is that a SELECT will block if you're trying to select records that have been updated in another transaction that hasn't committed yet.

Are you trying to select uncommitted data? What database are you using?

Alternatively your query may just be taking a really long time. Eliminate (or confirm) this possibility by running the query through some database tool.

You may also want to call setQueryTimeout() so the query won't block "forever".

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download