solomax commented on code in PR #262:
URL: https://github.com/apache/openjpa/pull/262#discussion_r4463103895


##########
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MariaDBDictionary.java:
##########
@@ -542,6 +547,36 @@ public Object getBlobObject(ResultSet rs, int column, 
JDBCStore store)
         return rs.getObject(column);
     }
 
+    /**
+     * Write the reader with {@link ResultSet#updateCharacterStream(int, 
Reader)}
+     * instead of the writer of {@link java.sql.Clob#setCharacterStream(long)}.
+     * The Connector/J clob writer starts at a wrong position when the clob was
+     * read from a result set and fails with an ArrayIndexOutOfBoundsException.
+     */
+    @Override
+    public void updateClob(Select sel, JDBCStore store, Reader reader)
+        throws SQLException {
+        SQLBuffer sql = sel.toSelect(true, store.getFetchConfiguration());
+        Connection conn = store.getConnection();
+        try (PreparedStatement stmnt = sql.prepareStatement(conn, 
store.getFetchConfiguration(),

Review Comment:
   ```suggestion
           try (Connection conn = store.getConnection(); PreparedStatement 
stmnt = sql.prepareStatement(conn, store.getFetchConfiguration(),
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to