Oracle Collections implementation#1425
Conversation
|
Thank you @blafond , I'll come back to you asap |
|
@blafond the test passes with a couple of changes: Index: vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/OracleArrayTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/OracleArrayTest.java b/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/OracleArrayTest.java
--- a/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/OracleArrayTest.java (revision 50ccabcc771b6c68ba27cda9d3d746efca1ecd42)
+++ b/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/OracleArrayTest.java (date 1710258134775)
@@ -37,8 +37,8 @@
public void testStringArray(TestContext ctx) {
String[] elements = {"str1", "str2", "str3"};
pool.withConnection(conn -> {
- Object stringsArray = ((OracleConnection)conn).createArray( "StringArrayType", elements );
- String insertSql = "INSERT INTO StringsArrayTable( id, stringsArray) VALUES (?, ?)";
+ Object stringsArray = ((OracleConnection)conn).createArray( "STRINGARRAYTYPE", elements );
+ String insertSql = "INSERT INTO StringsArrayTable( id, stringarrayelement) VALUES (?, ?)";
return conn.preparedQuery( insertSql ).execute( Tuple.of(1, stringsArray) );
}).onComplete( ctx.asyncAssertSuccess() );
}
|
tsegismont
left a comment
There was a problem hiding this comment.
Thank you @blafond , this goes in a good direction
I've commented in the PR about how to fix the test. I assume you are going to expand the test class?
In addition to the Javadoc, can you please also update the module doc vertx-oracle-client/src/main/asciidoc/index.adoc ?
| return connect(vertx, fromUri(connectionUri)); | ||
| } | ||
|
|
||
| Object createArray(String typeName, Object elements); |
There was a problem hiding this comment.
Can you please add some Javadoc to this method?
|
@tsegismont I tried your changes above and it just changed the case of the error: Did the test work for you? |
Yes it did |
|
@blafond I could reproduce your problem but still not able to fix it. I'll keep you informed |
|
So it doesn't work when the collection and dependent table are created in the init sql file. It does work if both are created with the Oracle client... I failed to understand to why so I reported my problem. I'll keep you informed |
|
Interesting, but I don't think in Hibernate Reactive we are creating then entries using the init sql. @blafond switched to a new role, I'm going to have another look at this as soon as I have some time. |
|
For the tests, in this PR, we do create the collection type and dependent table in the init sql file |
Yes, but it means that it should work in HR. I need to retest it there. |
Motivation:
Potential fix and test for #1392 : Support for Oracle Collections
ORM's recent support for Oracle arrays has added a custom array method to wrap an OracleConnection.
Hibernate Reactive uses vertx-sql-client to execute queries and does not use actual db client connections. This PR proposes a change in the vertx-sql-client to add a similar change to your OracleConnection interface and implementation to provide Hibernate Reactive access to the correct oracle array info/structure.
Commits include the proposed changes to the Oracle sql client and a test that currently fails