Selecting CLOB Across 21c Database Link Fails With "Clob Is Too Large to Be Stored in a Java String"
(Doc ID 2907406.1)
Last updated on NOVEMBER 07, 2022
Applies to:
JDBC - Version 12.1.0.2.0 and laterOracle Database - Enterprise Edition - Version 21.1 and later
Information in this document applies to any platform.
Symptoms
Given the following environment:
- Two 21c RDBMS instances connected using a database link
- Using any supported version of the Oracle JDBC driver
Executing a SQL SELECT statement that includes a LOB datatype across this dblink fails with the following exception:
Multiple conditions are necessary for the problem to reproduce. If any of the following conditions are removed, then the problem no longer reproduces:
- The select statement must go through a database link
- The problem only happens if both databases in the database link are at version 21c; the problem does not reproduce if either database is version 19c or lower
- The select statement must include both non-null CLOB rows and null CLOB rows
- Over 1500 rows must have been selected before the problem appears
- The problem only happens when the SELECT statement contains the clause "order by <NUMBER COLUMN> asc" or contains no "order by" clause at all -- but if it's set to "order by <NUMBER COLUMN> desc", the problem goes away
- The application code calls the CLOB rows using getString() -- if getClob() is used instead, the problem goes away
Changes
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Symptoms |
Changes |
Cause |
Solution |
References |