I am using sequence for saving domain object instance in my oracle database. I have a sequence for each table in the database. when I use the save functionality on User or Resource for example, It created a new resource on first try but the ID used was 70 ? the sequence shows the proper next number - 42 since max id in the table is 41. why was id=70 used to insert the new resource?
Also from the next try all inserts fail with this error
org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; SQL [insert into GRARESOURCE (decomm issioned, disabled, criticality, resourceClass, resourceGroupId, resourceName, ownerId, resourceSegmentId, resourceTypeId, riskSco re, targetIP, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [GRA.SYS_C0012183]; nested exception is org.hibernate.e xception.ConstraintViolationException: Could not execute JDBC batch update Not sure whats wrong because this is happening after code restructuring ...where we moved code into new packages..
Edit: I found out the cause, see my response..Thanks guys