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 and SQL Server Replication
PostPosted: Fri Jun 27, 2008 6:00 pm 
Newbie

Joined: Mon Feb 20, 2006 11:38 am
Posts: 2
When performing an "UPDATE" action through NHibernate on a SQL Server database which uses SQL Server Replication, the following error is returned:

"Unexpected row count: 2; expected: 1"

Obviously this makes sense since SQL Server replication adds "triggers" to the tables being replicated. I am aware of using the "SET NOCOUNT ON", but I am wondering if there is an NHibernate setting to not inspect the row count for UPDATE statements.

Any other solutions?

Thanks
Dennis


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 30, 2008 4:34 am 
Regular
Regular

Joined: Thu Mar 06, 2008 5:06 am
Posts: 68
Not at the moment, but I made an entry in JIRA about this issue: http://jira.nhibernate.org/browse/NH-1353


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 28, 2008 4:14 pm 
Newbie

Joined: Thu Dec 21, 2006 4:34 am
Posts: 13
I've just stumbled on a sql server book that said it is possible to globally "SET ROWCOUNT OFF" either for the target server or the user session. This is achieved by disabling the DONE_IN_PROC message. See: http://books.google.co.uk/books?id=fw9G ... &ct=result

I maybe wrong but it seems this would solve the issue with triggers but still allow the the toomanyrows excpetion to occur when under circumstances other than a trigger firing.

I have not tested this at all, but I thought it might help...

Christian


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.