hibernate/hibernate-orm · error · HibernateException

Multiple generators using the database sequence '%s' are def

Error message

Multiple generators using the database sequence '%s' are defined, with conflicting 'allocationSize' specifications: %s, %s

What it means

Error "Multiple generators using the database sequence '%s' are defined, with conflicting 'allocationSize' specifications: %s, %s" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/boot/model/relational/Sequence.java:104

	}

	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)

Solutions

  1. Use the same allocationSize in every @SequenceGenerator/@GenericGenerator that shares this database sequence.

Example fix

Use the same allocationSize in every @SequenceGenerator/@GenericGenerator that shares this database sequence.

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/99b65708f47e9090. Report an issue: GitHub.