java.sql.BatchUpdateException: ORA-02291: integrity constraint

錯誤日志:

      [31 12:02:03,906 WARN ] [Thread-11] util.JDBCExceptionReporter - SQL Error: 2291, SQLState: 23000 2009-8-31 12:02:04 org.zkoss.zk.ui.impl.UiEngineImpl handleError:1108 严重: >>org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update >>org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update [SQL: 2291, 23000] >>java.sql.BatchUpdateException: ORA-02291: integrity constraint (SGVD.TFACTCANCELLI_FK61247830083984) violated - parent key not found >> >> at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:342) >> at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10656) >> at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297) >> at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) >> at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246) >>...

 

錯誤分析:

      从字面来看,此错误为外键约束错误,经过检查发现,某字段在数据库中设置外键与Hibernate中引用的表对象不同而导致错误.

 

你可能感兴趣的:(sql,Hibernate,exception,数据库,jdbc,nested)