Looks like this is updating the timestamp value before it does the update
hibernate.cfg.xml:
Code:
<version name="civUpdateDt" column="CIV_UPDATE_DT" type="dbtimestamp"
generated="always" />
Nov 2, 2010 5:27:20 PM org.hibernate.engine.Versioning increment
FINEST: Incrementing: Tue Nov 02 16:42:16 EDT 2010 to 2010-11-02 17:27:20.234248
FINE: update EID.CIVILIANS set CIV_UPDATE_BY = 'JOHN', CIV_FNAME=?, CIV_LNAME=? where CIV_ID=? and CIV_UPDATE_DT=?
Hibernate: update EID.CIVILIANS set CIV_UPDATE_BY = 'JOHN', CIV_FNAME=?, CIV_LNAME=? where CIV_ID=? and CIV_UPDATE_DT=?
Nov 2, 2010 5:27:20 PM org.hibernate.jdbc.AbstractBatcher getPreparedStatement
FINEST: preparing statement
Nov 2, 2010 5:27:20 PM org.hibernate.persister.entity.AbstractEntityPersister dehydrate
FINEST: Dehydrating entity: [gov.dhs.ice.soa.ws.model.Civilians#473041]
Nov 2, 2010 5:27:20 PM org.hibernate.type.descriptor.sql.BasicBinder bind
FINEST: binding parameter [1] as [VARCHAR] - JOHN1
Nov 2, 2010 5:27:20 PM org.hibernate.type.descriptor.sql.BasicBinder bind
FINEST: binding parameter [2] as [VARCHAR] - BARR1
Nov 2, 2010 5:27:20 PM org.hibernate.type.descriptor.sql.BasicBinder bind
FINEST: binding parameter [3] as [INTEGER] - 473041
Nov 2, 2010 5:27:20 PM org.hibernate.type.descriptor.sql.BasicBinder bind
FINEST: binding parameter [4] as [TIMESTAMP] - 2010-11-02 17:27:20.234248
The old value, Tue Nov 02 16:42:16 EDT 2010, is what is in the database to that's why I'm getting an error. But I don't understand why you guys are updating the value at all if I set it to "generated". Shouldn't you just check against the old value and then re get after the database has updated the timestamp?
thanks,
Peter