lowcoder icon indicating copy to clipboard operation
lowcoder copied to clipboard

[Bug]: Oracle DB Queries fail when columns include BLOB/CLOB datatype

Open placidic opened this issue 1 year ago • 1 comments
trafficstars

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

When querying a oracle DB which returns a CLOB/BLOB datatype, the parsing engine fails and an "Oops..." error message is displayed to the user.

log files include the following

2024-09-12 18:57:39.863 ERROR o.l.api.framework.exception.GlobalExceptionHandler#lambda$doLog$8:155 POST /api/v1/query/execute [plugin-executor-7]:
133org.springframework.core.codec.CodecException: Type definition error: [simple type, class oracle.jdbc.OracleConnection]
134at org.springframework.http.codec.json.AbstractJackson2Encoder.encodeValue(AbstractJackson2Encoder.java:256)
135Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
136Assembly trace from producer [reactor.core.publisher.MonoMapFuseable] :
137reactor.core.publisher.Mono.map
138org.springframework.http.codec.json.AbstractJackson2Encoder.lambda$encode$7(AbstractJackson2Encoder.java:158)
139Error has been observed at the following site(s):
 
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Direct self-reference leading to cycle (through reference chain: org.lowcoder.api.query.view.QueryResultView["data"]->java.util.ArrayList[0]->java.util.LinkedHashMap["SEND_DATA"]->oracle.sql.BLOB["dbaccess"]->oracle.jdbc.driver.T4CConnection["wrapper"])
 

Expected Behavior

Query should run and parse Successfully with CLOB/BLOB Datatypes

Steps to reproduce

  1. Create and Oracle Data Source Connection
  2. Query an Oracle table containing a BLOB/CLOB Column in the resultset.

Environment

Lowcoder Self Hosted 2.4.5

Additional Information

After looking at the source code here for the oracle plugin: oraclePlugin/pom.xml

It appears that it is running v11.2.0.4 of the ojdbc6.jar library. This is woefully out of date and later versions appear to have resolved this issue, such as discussed On this Thread

Latest Oracle drivers are located here

placidic avatar Sep 19 '24 18:09 placidic

It may also be worth providing the user an option between which Oracle driver to use, and supporting multiple Oracle drivers, as there is a known backwards compatibility issue with newer Oracle drivers on older stacks. I'd recommend 23ai, 21c and 19c if that approach were developed. For a single driver I would recommend 19c for compatibility.

placidic avatar Sep 19 '24 18:09 placidic

This has been fixed and deployed in V2.6.3, so closing out this ticket.

adnanqaops avatar Feb 11 '25 06:02 adnanqaops