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

possible java.lang.ClassCastException when executing prepared statement

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.5
    • Component/s: Other
    • Labels:
      None

      Description

      exact error :

      java.lang.ClassCastException: class java.util.LinkedHashMap$Entry cannot be cast to class java.util.HashMap$TreeNode (java.util.LinkedHashMap$Entry and java.util.HashMap$TreeNode are in module java.base of loader 'bootstrap')
      	at java.base/java.util.HashMap$TreeNode.moveRootToFront(HashMap.java:1986)
      	at java.base/java.util.HashMap$TreeNode.treeify(HashMap.java:2102)
      	at java.base/java.util.HashMap.treeifyBin(HashMap.java:770)
      	at java.base/java.util.HashMap.putVal(HashMap.java:642)
      	at java.base/java.util.HashMap.put(HashMap.java:610)
      	at org.mariadb.jdbc.util.ClientParser.parameterParts(ClientParser.java:160)
      	at org.mariadb.jdbc.ClientPreparedStatement.<init>(ClientPreparedStatement.java:68)
      	at org.mariadb.jdbc.Connection.prepareInternal(Connection.java:156)
      	at org.mariadb.jdbc.Connection.prepareStatement(Connection.java:112)
      

      This is a concurency problem. a solution could be to use a ConcurrentHashMap, but after benchmarking the change, the solution would make it slower compare to not using cache at all, avoiding synchronized calls.
      So solution is to remove entirely (like 2.7)

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.