I am having exactly the same problem here.
This is the mapping file:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Server.Test03, Server" table="Table02" lazy="false">
<cache usage="read-write"/>
<id name="Key" column="myKey" unsaved-value="null">
<generator class="assigned" />
</id>
<version name="Version" column="version" type="Int32" unsaved-value="0" />
<property name="MyValue" column="myName" type="String" length="50"/>
</class>
</hibernate-mapping>
When i try to force (for testing purposes) a StaleObjectException this works fine. But as soon as I change the mapping file to use a stored procedure for updates like this:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Server.Test03, Server" table="Table02" lazy="false">
<cache usage="read-write"/>
<id name="Key" column="myKey" unsaved-value="null">
<generator class="assigned" />
</id>
<version name="Version" column="version" type="Int32" unsaved-value="0" />
<property name="MyValue" column="myName" type="String" length="50"/>
<sql-update>exec up_UpdateData3 ?, ?, ?, ?</sql-update>
</class>
</hibernate-mapping>
The data just gets updated and no stale exception is thrown when it should be. Why would this be the case does anyone know??
Clare
|