| Joined: Wed Feb 16, 2005 4:52 pm
 Posts: 1
 Location: Calgary, AB, Canada
 | 
				
					| Having a bit of a problem here with a unique constraint. I have a collection that references the following table:
 pkid_associate_region
 fkid_associate
 fkid_region
 value
 
 The table has a unique constraint on (fkid_associate, fkid_region). In other words, each associate record can have only 1 value per region.
 
 However, if the user deletes a record and then creates a new one in the same region that was deleted, it violates the unique constraint because it tries to perform the SQL inserts before the deletes.
 
 Is there any way to force Hibernate to process the deletes from the collection before the inserts?
 
 I'm calling saveOrUpdate() on the parent object which updates/inserts/deletes all of the child objects in the same transaction.
 
 Hibernate version: 2.1.7c, 24.11.2004
 
 Name and version of the database you are using: mysql  Ver 12.22 Distrib 4.0.18, for pc-linux (i686)
 
 
 |  |