-->
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: MS SQL 2005 + triggers -> TooManyRowsAffectedException
PostPosted: Thu Jun 26, 2008 5:18 am 
Newbie

Joined: Mon May 26, 2008 9:54 am
Posts: 1
Hibernate version: 2.0.0 Alpha 1

Name and version of the database you are using: MS SQL Server 2005

My program has to cover different SQL server (MS SQL 2005, Oracle, AS/400) and I stumbled about following exception in applications based on MS SQL Server 2005 and NHibernate:
NHibernate.AdoNet.TooManyRowsAffectedException : Unexpected row count: 2; expected: 1

The different row count is caused by triggers which are activated on every insert/update/delete.

I gave it a try with Oracle and the same triggers don't cause a different row count there. In addition my program has to run on AS/400 too, but I haven't tested it up to now.

I read several times about the "solution" with SET NOCOUNT ON in the triggers and one post even said it's "considered a best practice".
Is there any other approach to get NHibernate working with the different behaviours of the SQL servers? I consider it not a best practice to change the established database of a customer (or to alter the NHibernate source by myself).

I would love to hear about any suggestions.


Greetings


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.