Hibernate/JPA throws ConstraintViolationException when a SequenceGenerator is used and the sequence generator is also used by some external application
Issue
- The
org.hibernate.id.enhanced.SequenceStyleGenerator
retrieves the sequence value thanks to anextval
call and subtracts the JPAallocationSize
in order to use range values from (nexval
-allocationSize
) tonexval
. We would prefer the range to be from nexval to (nexval + allocationSize) instead.
Environment
- JBoss Enterprise Application Platform (EAP)
- 5
- 6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.