"OALL8 Is In an Inconsistent State" With 10.1.x.x and 10.2.x.x JDBC Thin Drivers When Selecting Non-ASCII Characters

(Doc ID 549409.1)

Last updated on AUGUST 16, 2016

Applies to:

JDBC - Version 10.1.0.5 to 10.2.0.4 [Release 10.1 to 10.2]
Information in this document applies to any platform.
***Checked for relevance on 15-Jan-2013***


Symptoms

When using the 10.2.0.3 or 10.2.0.4.0 JDBC thin driver to select non-ASCII characters from the database, the error "OALL8 is in an inconsistent state" is thrown.

The code below can be used to reproduce the issue:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class testJDBC {

  public static void main(String[] args) throws Exception
  {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@<host>:<port>:<SID>","<user>", "<pwd>");
    System.out.println("Connection Successful " + conn);
    Statement stmt = conn.createStatement();
    ResultSet  rs = null;
    try {
      System.out.println("here1");
      rs = stmt.executeQuery("select '\u0131' from dual");
    } catch (Exception e) {
      e.printStackTrace();
    }

    try {
      System.out.println("here2");
      rs = stmt.executeQuery("select 'a' from dual");
    } catch (Exception e) {
      e.printStackTrace();  
    }

    System.out.println("here3");
    if (rs.next()) {
      System.out.println("The value is : " + rs.getString(1));
    }
    stmt.close();
  }

}


The Error Stack thrown:

Connection Successful oracle.jdbc.driver.T4CConnection@18fb1f7
here1
java.lang.NullPointerException
at java.lang.String.<init>(String.java:173)
at oracle.sql.CharacterSet.AL32UTF8ToString(CharacterSet.java:1517)
at oracle.jdbc.driver.DBConversion.CharBytesToString(DBConversion.java:589)
at oracle.jdbc.driver.DBConversion.CharBytesToString(DBConversion.java:542)
at oracle.jdbc.driver.T4CTTIdcb.receiveCommon(T4CTTIdcb.java:163)
at oracle.jdbc.driver.T4CTTIdcb.receive(T4CTTIdcb.java:115)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:705)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:801)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:841)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1274)
at project1.testJDBC.main(testJDBC.java:20)
here2
java.sql.SQLException: OALL8 is in an inconsistent state
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at oracle.jdbc.driver.T4C8Oall.marshal(T4C8Oall.java:352)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:801)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:841)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1274)
at project1.testJDBC.main(testJDBC.java:27)
Exception in thread "main" java.lang.NullPointerException
at project1.testJDBC.main(testJDBC.java:33)


The same program, when run with the JDBC OCI driver, does not give any error.

Changes

Upgrade of JDBC driver and/or database.

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