1. JPA / Hibernate - ConstraintViolationException by removing an element stackoverflow.comI have a JPA/Hibernate problem with a n:m relation (Project <-> Person) with a join table. The Project is the mapping owner and has a (cascade = CascadeType.ALL). Now I want to ... |
2. save ConstraintViolationException forum.hibernate.orgNewbie Joined: Thu Aug 26, 2010 7:40 am Posts: 1 The exception stack trace is given. There is actually no constraint violation. Sometimes work intermittently. Seems to be a hibernate bug. Please advise urgently. at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497) Caused by: org.hibernate.exception.ConstraintViolationException: could not insert: [com.ibm.voyager.data.types.CustomerTag] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:40) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2158) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2638) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181) ... |
3. ConstraintViolationException on object update forum.hibernate.orgTrying to finish an application my predecessor began so I'm not entirely clear on some of my own code here sadly. It all seems to work fine for iinserting but updating isnt working (even when I havent made any changes to the object) Hibernate version: hibernate-3.0.5 Mapping documents: |
4. Need help on ConstraintViolationException and FLUSH mode forum.hibernate.orgNewbie Joined: Wed Aug 22, 2007 6:03 am Posts: 1 Hi All, I am using Criteria.list() to fetch an instance from database. which works perfectly everytime as it is a general code of my application used to fetch instances based on criterias provided. Also, i have set FlushMode = AUTO. Code: Session session = getSessionFactory().getCurrentSession(); ... |
5. Persist then merge if ConstraintViolationException is thrown forum.hibernate.orgBeginner Joined: Fri Dec 17, 2004 8:30 pm Posts: 20 Hibernate version: hibernate-entitymanager-3.3.1.jar Name and version of the database you are using: Postgres 8.3 The following code works for me. It uses some of my own utilities, but I hope the gist of it is clear. It persists a "vote" object unless doing so violates a unique constraint in which case ... |