Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Oracle JDBC OCI driver results in ORA-24806 when using NCLOBS

Oracle JDBC OCI driver results in ORA-24806 when using NCLOBS

From: Michael Meisinger <michael.meisinger_at_nets-ag.de>
Date: Sun, 22 Jul 2001 07:33:21 GMT
Message-ID: <9ijq0g$hr7$1@svr3.m-online.net>

Hi!

I've some tricky problem with the Oracle OCI JDBC driver. It occurs when reading and writing NCLOB data.
Using the Oracle thin driver (same jar file) has worked extensively with no problems in the same configuration for months!

Here's the problem:
Our web application connects well to the database with OCI and queries are handled pretty well. Even NVARCHAR2 data types can be used to save and read international character strings.

Then I insert EMPTY_CLOB() into a column. Data type of the column is NCLOB. Then I call a SELECT * FROM ... WHERE ... FOR UPDATE on the row. When updating the NCLOB by getting the clob object and doing the following, it fails in the call to flush():

    oracle.sql.CLOB oracleClob = (oracle.sql.CLOB) resultset.getClob("clob");

    Writer outW = oracleClob.getCharacterOutputStream();     BufferedWriter bufW = new BufferedWriter(outW, oracleClob.getBufferSize());

    bufW.write(str);
    bufW.flush();  // fails with IOException
    bufW.close();
    outW.close();

There is an IOException thrown stating that there is a "ORA-24806: LOB form mismatch."
- I get the same exception when reading from such a column in pretty much
the same way.
- I do not get the exception, when I write an empty string instead by
bufW.write("").
- However I do get the exception, when I read the previously written empty
string.
- And again: The same code works with no errors with the Thin pure Java
driver.

The Oracle technet states:

    ORA-24806 LOB form mismatch
    Cause: When reading from or writing into LOBs, the character set form of the user buffer should be same as that of the LOB.

    Action: Make sure that the buffer you are using to read or write has the same form as that of the LOB.

I did some extensive researches on the web and decompiling the driver code, but I haven't found anything so far. Here some results:
- OracleConnection.getDbCsId() returns 31 (WE8ISO8859P1)

I assume that some Oracle client configuration can be the source of the problem. Both client and test server were set up by my and use the default charset configurations. Intended is to write Java unicode strings into NVARCHAR2 and NCLOB columns.

The configuration:
Client and server on Windows NT 4 SP5. (In production it is Solaris) The Oracle client side installation is 8.1.6 with the default character set used (I think it is WE8ISO8859P1).
The Oracle database server installation is 8.1.6 with the default character set used (I think it is WE8ISO8859P1).
Using Java 1.3.0 with JDBC driver classes12.zip from Oracle client installation.

Any help is very appreciated.

Thanks,
Michael

--
Michael Meisinger
michael.meisinger_at_nets-ag.de
Received on Sun Jul 22 2001 - 02:33:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US