Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Integrity constraint in Hibernate

 
G. Prasad
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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(OraclePreparedStatement.java:10070)
at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:213)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:237)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at com.gp.songslib.dao.impl.SaveSongsInfoDaoImpl.saveAlbum(SaveSongsInfoDaoImpl.java:35)
at mysonglibrary.MySongLibrary.main(MySongLibrary.java:31)

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

DB : Oracle

DLL OF ALBUM :


DLL of SongDetails :
 
Rachna Jotwani
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting the same error. is there any updtae on how to fix this error?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic