Hey
I am trying to delete a column with primary key defined as:
<id name="mkey" column="mykey" type="int"> <generator class="identity" /> </id>
I let the "hibernate delete" function to delete an unexist id, this result in throwing exception In asynchronous manner:
Could not synchronize database state with sessionNHibernate.StaleStateException: Batch update returned unexpected row count from update; actual row count: 0; expected: 1 at NHibernate.AdoNet.Expectations.VerifyOutcomeBatched(Int32 expectedRowCount, Int32 rowCount) at NHibernate.AdoNet.SqlClientBatchingBatcher.DoExecuteBatch(IDbCommand ps) at NHibernate.AdoNet.AbstractBatcher.ExecuteBatchWithTiming(IDbCommand ps) at NHibernate.AdoNet.AbstractBatcher.ExecuteBatch() at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)
What is the best way to handle this situation on my server. I want to assume that my server can got an unexist id.
Thanks Lilach
|