springframework « DAO « JPA Q&A





1. Getting org.springframework.dao.DataIntegrityViolationExcept    forum.hibernate.org

Hi I've parent table called supplier and child table called contact. Supplier has one to many relation with contact. While I am trying to save the both I am getting the above exception Hibernate is trying to save the child table first, and giving the following error. org.springframework.dao.DataIntegrityViolationException: Hibernate operation: ORA-02291: integrity constraint (SCOTT.SYS_C005854) violated - parent key not found ; ...

2. org.springframework.dao.InvalidDataAccessApiUsageException    forum.hibernate.org

I try to add one child object ,but always have a problem: org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition parent.hbm.xml: .......... ......... child.hbm.xml: ..........

3. Problem: org.springframework.dao.DataIntegrityViolationExcep    forum.hibernate.org

Newbie Joined: Thu Mar 15, 2007 12:22 am Posts: 1 Oops! Something wrong! Problem: org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.xibos.calendar.model.RepeatEventTypeOne]; SQL [insert into calendar_repeating_event_type_one (repeat_on, repeat_time_period, event_end_date, repeat_date, repeat_id) values (?, ?, ?, ?, ?)]; The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by ...