i'm trying to update a master/detail class but i always get this exception :
SQL insert, update or delete failed (expected affected row count: 1, actual affected row count: 0). Possible causes: the row was modified or deleted by another user, or a trigger is reporting misleading row count.
C# MASTER definiotions of property details
---
private IList m_details;
public IList Details
{
get { return m_details; }
set { m_details = value; }
}
---
the exception was thown when i flush the session
C# code to save
---
this.m_session.SaveOrUpdate(this.Header);
this.m_session.Flush();
---
Hibernate version: 1.0.2
Mapping documents:
MASTER
---
<class name='CUP.Header, CUP' table='HEADER'>
<composite-id>
<key-property name='Year' column='PREANN' />
<key-property name='Number' column='PRENUM' />
</composite-id>
<property name='Type' column='PRETIP' />
<bag name='Details'>
<key>
<column name='PREANN' />
<column name='PRENUM' />
</key>
<one-to-many class='CUP.ReservationDetail, CUP' />
</bag>
</class>
---
DETAIL
---
<class name='CUP.Details, CUP' table='DETAILS'>
<composite-id>
<key-property name='Year' column='PREANN' />
<key-property name='Number' column='PRENUM' />
<key-property name='DetailRow' column='PRERIG' />
</composite-id>
<property name='ReservationDate' column='PREDAP' />
</class>
P.S: i remove useless properties.
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using: Oracle 10g
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
|