Updated recently

Sequence increment is not correctly determined
HHH-13322
@Where clause is ignored when eagerly loading ManyToOne association
HHH-12104
'A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance' when persisting, flushing, detaching and merging an Entity in the same Session (using Bytecode enhancement)
HHH-13735
Allow to delegate the clearing of JDBC warnings on Connection close to the Connection Pool implementor
HHH-13880
Fix an obvious bug in StandardStack implementation
HHH-13876
Increase the scope of some methods to make them accessible outside of Hibernate ORM
HHH-13878
Slow query log should use System#nanoTime not System#currentTimeMillis
HHH-13879
Legacy Criteria API: could not resolve Property on One-To-One @PrimaryJoinColumn with hibernate
HHH-13313
Use FetchMode.Join to load OneToOne associations that have the same AssociationKey as the entity owner
HHH-13085
size() does not work properly as select expression
HHH-13619
Introduce an option to Log slow queries instead of all queries
HHH-13249
Remove unnecessary declaration of JtaManager in HibernatePersistenceProviderAdaptor
HHH-13855
Optional one-to-one does not always join the associated entity table when querying
HHH-13875
Gradle plugin causes compile task to be always out of date
HHH-13870
Make '@SortNatural' as default for SortedSet and SortedMap
HHH-13877
Avoid join on property access mapped by natural id
HHH-12775
StaleObjectStateException into a SINGLE transaction for entity with version field of type java.util.Date
HHH-13867
Deprecate relevant methods that are supposed to be removed in v6.0
HHH-13874
Make the Java Stream close the underlying ScrollableResultsIterator upon calling a terminal operation
HHH-13872
OneToOne-association produces error on 5.4.0+ when using PostgreSQL
HHH-13866
Incorrect metamodel for basic collections
HHH-12338
Custom NamingStrategy should be able to define unique column names for CompositeUserType's with 2 columns or more.
HHH-11812
IdTableHelper can skip opening a connection when there's no statements to execute
HHH-13873
issue 1 of 23

Sequence increment is not correctly determined

Description

Switching from Hibernate 5.3.7 to 5.4.1 some of our JUnit-Tests failed with the following message:

But a quick look on the Oracle DB showed that the sequence GA_NODEINFO_OID_SEQ had the increment set to 50. So the message is clearly not right.

Cause for this error is probably a bug in the heuristic to determine the increment of a sequence.

In our case the problem is that the metadata for the sequence can not be determined, because the sequence is a synonym to a sequence in a different schema, i.e. the name of the current schema is not in the table all_sequences.

In the SequenceStyleGenerator the schema name is therefore null

and the increment value is in consequence the value of the first sequence with the same sequence name.

Unfortunately our test DB contains more than one schema with the same setup, so the sequence name is not unique within the DB and the increment has changed over time. So we get sometimes the wrong increment value from a sequence in a different schema.

So in our case it would be correct to return an increment value only if sequence name and schema name (or catalog name) are matched.

Environment

Hibernate: 4.5.1.FINAL
JVM: Oracle JDK 1.8.0_181
OS: Windows 7 and SLES 12 SP3
DB: Oracle 12.2 and Oracle 18c

Assignee

Unassigned

Reporter

Florian Kaiser

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.3.7

Affects versions

Priority

Major
Configure