Two Laptop Bag
The moose likes Object Relational Mapping and the fly likes Integrity constraint in Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Integrity constraint in Hibernate" Watch "Integrity constraint in Hibernate" New topic

Integrity constraint in Hibernate

G. Prasad

Joined: Feb 18, 2012
Posts: 1
I m Even facing the same error ...

I don know why even the FK of Song details are matching with the Pk of the Album i mm getting the below mentioned error:

java.sql.BatchUpdateException: ORA-02291: integrity constraint (SONGSLIB.SONGSDETAIL_ALBUM_FK1) violated - parent key not found

at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(
at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(
at org.hibernate.jdbc.AbstractBatcher.executeBatch(
at org.hibernate.engine.ActionQueue.executeActions(
at org.hibernate.engine.ActionQueue.executeActions(
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(
at org.hibernate.impl.SessionImpl.flush(
at mysonglibrary.MySongLibrary.main(

While debugging i found it's coming when i m going for flush or commit.

DB : Oracle


DLL of SongDetails :
Rachna Jotwani

Joined: Apr 17, 2012
Posts: 2
I am getting the same error. is there any updtae on how to fix this error?
I agree. Here's the link:
subject: Integrity constraint in Hibernate
It's not a secret anymore!