-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: NHibernate and oracle update via stored procedure
PostPosted: Fri Jun 10, 2011 10:53 am 
Newbie

Joined: Fri Jun 10, 2011 9:29 am
Posts: 1
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,


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.