hibernate-reactive
hibernate-reactive copied to clipboard
Default array mapping doesn't work for Oracle
For Oracle, Hibernate ORM define custom types to map arrays. We can create the same types with Vert.x SQL client but when we try an insert we have an exception.
Vert.x doesn't support user types at the moment: https://github.com/eclipse-vertx/vertx-sql-client/issues/1392
We test arrays in JavaTypesArrayTest
We've created a PR for Vert.x that should be able to help us fix this issue, but we are waiting for the team to review it.
I don't think it's the right approach, but we should check if this solution is doable and solve the issue.
@DavideD debugged array test with Oracle DB today. The ResultSetAdapter ends up finding a ReactiveOracleArrayJdbcType instance but isn't processing it completely, so I'm hoping it isn't a big fix.
@blafond, make sure to check the chat I had with Thomas: https://github.com/eclipse-vertx/vertx-sql-client/issues/1392
I'm not sure how this array is created, but we need to do the same: https://github.com/hibernate/hibernate-orm/blob/d90d6e63f017b5ebe4294b5850e0fad155acdd4f/hibernate-core/src/main/java/org/hibernate/dialect/OracleArrayJdbcType.java#L114
@DavideD ORM's OracleArrayJdbcType utilizes the actual Oracle connection & driver which calls OracleConnection.createOracleArray() interface into Oracle's PhysicalConnection.createOracleArray()
Vertx connection framework only implements it's own connection hierarchy ending up with an OraclePool and OracleConnection interfaces that don't do much except managing connection and facilitating queries and results.
I'm not finding a path to get the actual DB connection through Vertx... which I wouldn't expect I guess.
note that ReactiveOracleArrayJdbcType.getArray(...) is the proper place to convert the array. I was able to get a vertx OracleConnection however there were no methods to help us.
OracleConnection however there were no methods to help us.
What do you mean? This is the method we need to call: https://docs.oracle.com/en/database/oracle/oracle-database/21/jajdb/oracle/jdbc/OracleConnection.html#createARRAY_java_lang_String_java_lang_Object_