Hi,
Before I start I would like to say hello to all of you guys as it is my first post
I have been struggling with some nasty problem for over a week now and still cannot find the solution maybe I will find it here.
I’m using ASP.NET, Oracle and NHibernate 3.0 and I want to update my entity via stored procedure.
I have created the mapping I have added sql-update where I put calling statement.
<class name="System" table="SEC_SYSTEMS" select-before-update="true">
<id name="Id" column="C_SEC_SYSTEMS_ID" unsaved-value="-1"> <generator class="trigger-identity" /> </id> …
<sql-update> call P_UPDATE_SYSTEM(?,?) </sql-update>
Below here is the code for updating:
using (ITransaction trans = this.BeginTransaction()) { try { this.ActiveSession. SaveOrUpdate (entity); trans.Commit(); } catch { trans.Rollback(); } }
But I still receive the exception: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)
In the stack trace there is another info: Hibernate.Event.Default.AbstractFlushingEventListener: ERROR - NHibernate.Event.Default.AbstractFlushingEventListener - Could not synchronize database state with session
The weird thing is that the similar approach works ok with insert.
Thanks in advance for any help. This is killing me. Regards,
|