This is an automated email from the ASF dual-hosted git repository.

amashenkov pushed a commit to branch ignite-17154
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 168b2642e6cbc8bb6bd2ba0a4be404f7028c23f7
Author: Andrew Mashenkov <[email protected]>
AuthorDate: Fri Jun 10 15:08:28 2022 +0300

    Fix.
---
 .../ignite/internal/jdbc/thin/JdbcThinConnection.java       | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java
index 072858948f9..737cbebb80f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java
@@ -132,6 +132,7 @@ import static java.sql.ResultSet.TYPE_FORWARD_ONLY;
 import static 
org.apache.ignite.internal.processors.odbc.SqlStateCode.CLIENT_CONNECTION_FAILED;
 import static 
org.apache.ignite.internal.processors.odbc.SqlStateCode.CONNECTION_CLOSED;
 import static 
org.apache.ignite.internal.processors.odbc.SqlStateCode.CONNECTION_FAILURE;
+import static 
org.apache.ignite.internal.processors.odbc.SqlStateCode.DATA_EXCEPTION;
 import static 
org.apache.ignite.internal.processors.odbc.SqlStateCode.INTERNAL_ERROR;
 import static 
org.apache.ignite.marshaller.MarshallerUtils.processSystemClasses;
 
@@ -1018,6 +1019,18 @@ public class JdbcThinConnection implements Connection {
 
                     throw e;
                 }
+                catch (BinaryObjectException e) {
+                    String err = "Serialization error during sending an sql 
request. " +
+                        "The error can be caused by the fact that the classes 
used on the node are missing " +
+                        "on the client. Try to use JDBC connection option 
'keepBinary=true' " +
+                        "to to avoid deserialization. Also you can use system 
property " +
+                        "IGNITE_SENSITIVE_DATA_LOGGING=\"plain\" to readable 
print content of a BinaryObject";
+
+                    if (LOG.isLoggable(Level.FINE))
+                        LOG.log(Level.FINE, err, e);
+
+                    throw new SQLException(err, DATA_EXCEPTION, e);
+                }
                 catch (Exception e) {
                     if (LOG.isLoggable(Level.FINE))
                         LOG.log(Level.FINE, "Exception during sending an sql 
request.", e);

Reply via email to