Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-849

con/j should not close connection caused java.io.NotSerializableException as a result of incorrect data bind to a prepared statement parameter

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 2.6.2, 2.7.1
    • 2.7.2
    • Other
    • None

    Description

      If java.io.NotSerializableException is thrown as a result of incorrect data bind to a prepared statement parameter, JDBC driver closes the connection.
      Instead, it should treat java.io.NotSerializableException differently similar to how it is handling MaxAllowedPacketException.

      AbstractQueryProtocol

      NotSerializableException is a transient exception that can be handled without having to close the connection.

      Attachments

        Activity

          diego dupin Diego Dupin added a comment - - edited

          this can only occur when using setObject​(int parameterIndex, Object x) and object type cannot be identified.

          Best implementation for this specific case would have to throw an exception immediately, but for compatibility sake with previous version (and at some point compatibility with mysql driver) driver serialize object. Handling NotSerializableException to throw exception without discarding connection seems appropriate.

          Be aware that in future 3.x version, serialization won't be handle, throwing an exception immediatly on setObject().

          diego dupin Diego Dupin added a comment - - edited this can only occur when using setObject​(int parameterIndex, Object x) and object type cannot be identified. Best implementation for this specific case would have to throw an exception immediately, but for compatibility sake with previous version (and at some point compatibility with mysql driver) driver serialize object. Handling NotSerializableException to throw exception without discarding connection seems appropriate. Be aware that in future 3.x version, serialization won't be handle, throwing an exception immediatly on setObject().

          People

            diego dupin Diego Dupin
            Richard Richard Stracke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.