Setquerytimeout() Has No Effect When Executing a Batch - ORA-01013 Exception Not Returned (Doc ID 466664.1)

Last updated on AUGUST 16, 2016

Applies to:

JDBC - Version: 9.2.0.8 to 10.2.0.3
This problem can occur on any platform.

Symptoms

Using the 10.2.0.3 Thin  JDBC driver, the setQueryTimeout() method  has no effect when executing a batch consisting of  update statements.

The sequence of code is the following :

PreparedStatement ps = conn.prepareStatement ("update ...")
ps.setQueryTimeout(1);
..
addBatch ()
- ..
addBatch ()
ps.executeBatch();


If locking some rows that  are updated by the batch, the JDBC application is hanging on the following call :

ps.executeBatch();

The expected behavior is that the JDBC  application received the following exception :
java.sql.SQLException: ORA-01013: user requested cancel of current operation

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms