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.  [ 3 posts ] 
Author Message
 Post subject: Unexpected row count when trying to update a table w/trigger
PostPosted: Thu Dec 18, 2008 9:10 am 
Newbie

Joined: Thu Dec 18, 2008 8:57 am
Posts: 1
Hello,

I have a problem when I try to update a table that has a trigger.

I've read that I should write "set nocount on" on the trigger, but that's not possible for me.

What I've done is send a "set nocount on" before running:
session.SaveOrUpdate(item);
session.Transaction.Commit();


But, that doesn't work because NHibernate is getting -1 row count and it throws the exception "unexpected row count -1; expected 1"

Is there a way to fix this WITHOUT changing the trigger?

I'm working with C# - VS 2005, .Net Framework 2.0, NHibernate version 2.0.0.4000, Sybase Database ASE 12.5

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 19, 2008 6:40 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
No, not that I know of.

_________________
--Wolfgang


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 31, 2008 12:02 pm 
Newbie

Joined: Wed Dec 31, 2008 11:53 am
Posts: 1
It seems like an old problem:

http://blog.stevehorn.cc/2007/11/nhiber ... er-in.html

but I have found no solution..

I have a similar problem on postgresql - I have rules which do additional inserts or updates and so the updated row count is not what NHibernate expects and nhibernate gets an error..

Is there any way to disable this annoying check in NHibernate???


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

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.