Hibernate version:2.1.2
Mapping documents: <?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping> <class name="com.systec.lifetec.labs.valueobjects.ResultCodeVO" table="tbl_test_result_code" dynamic-update="false" dynamic-insert="false" >
<id name="resultCode" column="result_code" type="java.lang.String" > <generator class="assigned"> </generator> </id>
<timestamp name="updateDateTime" column="updt_datetime" />
<property name="description" type="java.lang.String" update="true" insert="true" column="description" />
<property name="active" type="boolean" update="true" insert="true" column="active" />
<property name="showInLegend" type="boolean" update="true" insert="true" column="show_in_legend" />
<property name="userID" type="java.lang.String" update="true" insert="true" column="updt_userid" not-null="true" />
<!-- To add non XDoclet property mappings, create a file named hibernate-properties-ResultCodeVO.xml containing the additional properties and place it in your merge dir. -->
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Session ss=openSession(); Transaction tr=ss.beginTransaction(); ss.update(resultCodeVO) tr.commit(); ss.close(); [PS-resultCodeVO is an object of ResultCodeVO class]
Full stack trace of any exception that occurs:
Hibernate: update tbl_test_result_code set updt_datetime=?, description=?, activ e=?, show_in_legend=?, updt_userid=? where result_code=? and updt_datetime=? net.sf.hibernate.StaleObjectStateException.<init>(StaleObjectStateException.java :27) -- An operation failed due to stale data net.sf.hibernate.StaleObjectStateException: Row was updated or deleted by anothe r transaction (or unsaved-value mapping was incorrect) for com.systec.lifetec.la bs.valueobjects.ResultCodeVO instance with identifier: QW
Name and version of the database you are using: SQL Server 2000
Debug level Hibernate log excerpt:
|