ORA-01002 : 'Fetch Out of Sequence' Encountered When Using 'select... for update' in JDBC (Doc ID 1160014.1)

Last updated on AUGUST 03, 2016

Applies to:

JDBC - Version 10.1.0 to 11.1.0.6
Oracle Containers for J2EE - Version 10.1.3.0.0 and later
Information in this document applies to any platform.

Symptoms

When executing a SELECT FOR UPDATE through the OCI JDBC driver with the 'Auto Commit' enabled, following error is reported:
java.sql.SQLException: ORA-01002: fetch out of sequence

The same problem is not seen using Oracle Thin drivers.

The full stack trace of the error extracted from the log file is as follows:

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