MS SQL Update statement w/ update trigger returns row-count > 1

Description

I have a table in an MS SQL 2005 database that has an update trigger. When I try issuing ISession.Flush(), or ITransaction.Commit, I get a TooManyRowsAffectedException exception thrown in the AbstractEntityPersister.Update() method. The row-count returned by MS SQL is 2, not 1, because of the update trigger. I tracked the source of the TooManyRowsAffectedException exception to the fact that ExecuteUpdateResultCheckStyle.DetermineDefault() returns ExecuteUpdateResultCheckStyle.Count. As a work-around, I changed ExecuteUpdateResultCheckStyle.DetermineDefault() to return ExecuteUpdateResultCheckStyle.None. Is there another way to resolve this issue?

Environment

None

Activity

Show:
Former user
January 31, 2007 at 8:55 AM

I misunderstood the problem you are having, but still the best way is to discuss it on the forum. You have two options - either change the trigger to report the right rowcount (using set nocount on), or use custom SQL support.

Former user
January 31, 2007 at 8:46 AM

Please ask questions on the forum (http://forum.hibernate.org), JIRA is for entering bug reports. You can use <sql-insert check="none">.

Not an Issue

Details

Assignee

Reporter

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created January 31, 2007 at 8:35 AM
Updated January 31, 2007 at 8:55 AM
Resolved January 31, 2007 at 8:46 AM
Who's Looking?