Duplicate entry error in MySQL/Hibernate -
I am facing the following problem and can not find the appropriate solution I have property ID, x (foreign key) There is a relation with y (sequence number) and z (content). Apart from this, there is a specific disturbance on x-yy. I usually have tuples (455, 159, 1, ...), (456, 159, 2, ...), (457, 15 9, 3, ...) etc. I am using hibernate and it is a mapping table for a certain class. Now I have a case of use, where I want to insert a new object, or remove an already existing one and update the sequence number of other objects. For example, if I insert a new object after 1, then it should get the sequence number 2 and later the object that is 2 be 3, 3 should be 4, etc. Something like this should be done while removing the object - it should be the old 3 and 2, etc. However, once an update has started I get a restriction violation. Critical: The session could not synchronize the database state with org.hibernate.exception.ConstraintViolationException: java.sql.BatchUpdateExcept...