Statement Caching Needs Table Structure To Be Retained in the Database (Doc ID 1361340.1)

Last updated on AUGUST 03, 2016

Applies to:

JDBC - Version 10.2.0.1 to 11.2.0.2.0 [Release 10.2 to 11.2]
Information in this document applies to any platform.

Symptoms

When the table is altered in its structure and a Statement is reused on client side (Statement originally created and executed before the alter) in JDBC,  this results in various errors:
    - Protocol Violation
    - java.lang.ArrayIndexOutOfBoundsException
    - lockup (hang) forever, causing 100% cpu usage


For example:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -128
at oracle.jdbc.driver.NumberCommonAccessor.getBigDecimal(NumberCommonAccessor.java:2631)
at oracle.jdbc.driver.NumberCommonAccessor.getObject(NumberCommonAccessor.java:3246)
at oracle.jdbc.driver.T4CNumberAccessor.getObject(T4CNumberAccessor.java:305)
at oracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java:1094)


or

java.sql.SQLException: Protocol violation
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:459)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)

Changes

- table structure was altered and a Statement is reused
- select * is being used

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