When using a pooled sequence optimizer, although the sequences in the DB have correct increment size, the SequenceStyleGenerator throws a MappingException {quote}The increment size of the \[s_test \ ] sequence is set to \[1000 \ ] in the entity mapping while the associated database sequence increment size is \[1 \ ].{quote} The problem was root caused in the Oracle dialect (all dialects are affected), more specifically the problem is caused by the fact that no schema column name is returned by this method {{org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorOracleDatabaseImpl.sequenceSchemaColumn()}} We have multiple schemas on the same database (that contain sequences that have same names, however different increment steps). Considering that the QualifiedSequenceName _QualifiedSequenceName_ in the sequence information list returned by the {{org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorLegacyImpl.extractMetadata(ExtractionContext)}} is composed from catalog name, schema name and sequence name and the fact that both the schema name and the catalog name will be always null, hibernate has no way to identify the correct sequence for the list of fetched sequences (if multiple schemas contain the same sequence name - as in our case). |
|