lowcoder-org / lowcoder

🔥 🔥 🔥 The Open Source Retool, Tooljet and Appsmith Alternative
https://www.lowcoder.cloud/
GNU Affero General Public License v3.0
905 stars 187 forks source link

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

Open placidic opened 1 month ago

placidic commented 1 month ago

Is there an existing issue for this?

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 commented 1 month ago

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.