"Error ORA-02290: check constraint X violated" in Hibernate application. What can I do to fix it?

Solution Verified - Updated -

Issue

When performing updates in database using Hibernate, we have the following exception:

ERROR [org.hibernate.util.JDBCExceptionReporter] (http-0.0.0.0-8080-3) ORA-02290: check constraint {Constraint name} violated

And then the following error prevent the update to be finished:

ERROR [org.hibernate.event.def.AbstractFlushingEventListener] (http-0.0.0.0-8080-3) Could not synchronize database state with session

How to troubleshoot this problem?

Environment

  • JBoss Enterprise Application Platform 5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In