Hibernate/JPA throws ConstraintViolationException when a SequenceGenerator is used and the sequence generator is also used by some external application

Solution Verified - Updated -

Issue

  • The org.hibernate.id.enhanced.SequenceStyleGenerator retrieves the sequence value thanks to a nextval call and subtracts the JPA allocationSize in order to use range values from (nexval - allocationSize) to nexval. 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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content