HibernateException: Unexpected row count

Hello,
I have a serious problem with my Hibernate mappings which where generated by DBVA and am really stuck.

I have a normal relation between an Order, Customer, Customer’s Address and the OrderLines and am not able the save (Update) my Order. Other Objects I can save without a problem.
Now I found out, that when I remove the cascade=“lock” from the mappings it works for some updates but not for others.

This is the Error message:
org.hibernate.HibernateException: Unexpected row count: 0 expected: 1

Do you have any ideas?

Best Regards
Zwitsch

My Order.hbm.xml

<?xml version="1.0" encoding="utf-8" ?>
<!--
Licensee: Thomas Z
License Type: Purchased
-->
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
	<class name="com.wlgore.hbm.Order" table="MSOE_Order" lazy="false">
		<id name="OrderId" column="OrderId" type="integer" unsaved-value="0">
			<generator class="native">
			</generator>
		</id>
		<property name="season" column="Season" type="string" length="255" not-null="false"/>
		<property name="address1" column="Address1" type="string" length="255" not-null="false"/>
		...snip... (just other cols like the others)
		<property name="customerPo" column="CustomerPo" type="string" length="255" not-null="false"/>
		<many-to-one name="Sales" column="SalesId" class="com.wlgore.hbm.Sales">
		</many-to-one>
		<many-to-one name="ShipTo" column="Shipto" class="com.wlgore.hbm.Address">
		</many-to-one>
		<many-to-one name="Customer" column="CustomerId" class="com.wlgore.hbm.Customer">
		</many-to-one>
		<many-to-one name="Status" column="Status" class="com.wlgore.hbm.Status">
		</many-to-one>
		<set name="Incident" lazy="true" cascade="save-update" inverse="true">
			<key column="OrderId" not-null="false"/>
			<one-to-many class="com.wlgore.hbm.Incident"/>
		</set>
		<set name="OrderLine" lazy="true" cascade="save-update" inverse="true">
			<key column="OrderId" not-null="true"/>
			<one-to-many class="com.wlgore.hbm.OrderLine"/>
		</set>
	</class>
</hibernate-mapping>

Dear Zwitsch,

Sorry for the problem. I have forwarded your case to our engineers. Once there is any feedback from them, I will inform you immediately.

Best Regards,
Jick

Hello Jick,
I can provide you the wohle bunch of mapping files, if that is more helpful. If you want them, can you please tell me the email address?

Thanks a lot!
Zwitsch

Hi Zwitsch,

Please send me the mapping files so that we can locate the problem easier. One question, is the problem associated with objects loaded by other session? Could you please reply me with more detail? Finally, please send me the generated code if possible. We would like to repeat the problem as you described.

Here is my email address:
jick@visual-paradigm.com

Best Regards,
Jick