-->
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: StaleStateException
PostPosted: Thu Jun 30, 2016 11:13 am 
Newbie

Joined: Wed Aug 10, 2011 9:52 am
Posts: 2
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


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.