Uploaded image for project: 'Hibernate ORM'
  1. HHH-1697

OracleDialect fails to recognize sequence accessible through syonyms when validating schema

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.0.CR1
    • Fix Version/s: 3.3.0.CR2
    • Component/s: hibernate-core
    • Labels:
      None
    • Environment:
      Hibernate 3.1.2, Hibernate 3.1.3 Oracle 10g
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      The Dialect implementations in OracleDialect and Oracle9Dialect fails to recognize sequences upon validation when they are accesssed through synonyms
      because the user_sequences table will not create when the sequence is acced through a synonym. This is needed when using hibernate.hbm2ddl.auto=validate
      which is a very useful feature.

      Thus sequences returned by:

      public String getQuerySequencesString()

      { return "select sequence_name from user_sequences"; }

      will mot identify sequences accessible using a synonym.

      By using this implementation:

      public String getQuerySequencesString() {
      return "select sequence_name from user_sequences " +
      "union " +
      "select synonym_name from user_synonyms us " +
      "where exists (select 1 from all_objects ao where object_type='SEQUENCE' and " +
      "us.table_name = ao.object_name)";
      }

      orale will also return sequences acccessible though synonyms.

        Attachments

          Issue links

            Activity

              People

              • Votes:
                5 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: