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

NPE in OkPacket when setting auto commit

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.1.4
    • 3.3.2
    • Other
    • None
    • Database:
      AWS RDS MariaDB 10.5.21 with RDS Proxy

      Application:
      SpringBoot 2.7
      MariaDB Connector 3.1.4

      Base docker image:
      adoptopenjdk/openjdk11-openj9:jre

    Description

      We are encountering occasional NPE in production environment.

      When our spring based application starts to create transaction and set auto commit to false (which is calling `Connection.setAutoCommit()`), NPE is thrown in https://github.com/mariadb-corporation/mariadb-connector-j/blob/3.1.4/src/main/java/org/mariadb/jdbc/message/server/OkPacket.java#L52C19-L52C19

      Given line 51, `database` is possible to be null while in line 52 it's trying to invoke `database.isEmpty()`, therefore NPE is thrown.

      In addition, may I ask why calling `Connection.setAutoCommit()` can result in having `StateChange.SESSION_TRACK_SCHEMA` in the OkPacket?
      and in what situation `StateChange.SESSION_TRACK_SCHEMA` will be returned but the subsequent data will be null?

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            mcfung Mike Chung
            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.