hibernate/hibernate-orm · error · HibernateException
Multiple generators using the database sequence
Error message
Multiple generators using the database sequence '%s' are defined, with conflicting 'initialValue' specifications: %s, %s
What it means
Sequence.validate found multiple id generators sharing the same physical database sequence but specifying different initialValue settings. Hibernate cannot honor both; make the conflicting @SequenceGenerator/generator declarations agree on initialValue (or point them at different sequences).
Solutions
- Use the same initialValue in every @SequenceGenerator/@GenericGenerator that shares this database sequence.
Example fix
Use the same initialValue in every @SequenceGenerator/@GenericGenerator that shares this database sequence.
Defensive patterns
Strategy: validation
When it happens
Trigger: An entity mapping annotation or bootstrap configuration violates a Hibernate mapping rule.
Common situations: Annotation mapping mistakes: inverse-side @Id associations, @Column on @OneToOne, unmapped association targets, mismatched @EnumeratedValue/@Temporal usage, duplicate sequence generators.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/601500c907f2b632.
Report an issue: GitHub.
Appendix: source
Thrown at hibernate-core/src/main/java/org/hibernate/boot/model/relational/Sequence.java:94
public String getContributor() {
return contributor;
}
public int getInitialValue() {
return initialValue;
}
public int getIncrementSize() {
return incrementSize;
}
public String getOptions() {
return options;
}
public void validate(int initialValue, int incrementSize) {
if ( this.initialValue != initialValue ) {
throw new HibernateException(
String.format(
"Multiple generators using the database sequence '%s' are defined, with conflicting 'initialValue' specifications: %s, %s",
exportIdentifier,
this.initialValue,
initialValue
)
);
}
if ( this.incrementSize != incrementSize ) {
throw new HibernateException(
String.format(
"Multiple generators using the database sequence '%s' are defined, with conflicting 'allocationSize' specifications: %s, %s",
exportIdentifier,
this.incrementSize,
incrementSize
)
);
}View on GitHub (pinned to fad1729dce)