EntityManager NativeQuery bugs in Oracle and SQL Server

XMLWordPrintable

    • Severity 2 - Major

      Issue Summary

      This is reproducible on Data Center: yes

      When doing native query via Entity Manager:

      With Oracle, the java.lang.ClassCastException will occur;

      With SQL Server, java.lang.ClassCastException and org.hibernate.loader.custom.NonUniqueDiscoveredSqlAliasException will occur

      Steps to Reproduce

      1. use Oracle or SQL Server as the database
      2. open Confluence Question(java.lang.ClassCastException)
      3. check question statistics(org.hibernate.loader.custom.NonUniqueDiscoveredSqlAliasException)

      Expected Results

      No errors and show questions or statistics correctly

      Actual Results

      The below exception is thrown:

      1. java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to java.lang.Number
      at com.atlassian.confluence.plugins.questions.util.ResultSetHelper.getLong(ResultSetHelper.java:20)
      
      
      2. org.hibernate.loader.custom.NonUniqueDiscoveredSqlAliasException: Encountered a duplicated sql alias [] during auto-discovery of a native-sql query
      at com.atlassian.confluence.plugins.questions.contenttype.repository.ContentTypeStatisticRepository.getContentCreationTimeSeries(ContentTypeStatisticRepository.java:205)
       

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

            Assignee:
            Marcus Si
            Reporter:
            Marcus Si
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: