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
|