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.  [ 4 posts ] 
Author Message
 Post subject: Upon row delete, trigger fires which causes error
PostPosted: Tue Apr 01, 2008 2:16 pm 
Newbie

Joined: Tue Apr 01, 2008 8:55 am
Posts: 4
The error below is caused for the following reason. I delete a row (via nhibernate) from a table called "callsign". that works, but causes a trigger to fire which deletes a row from another table (this needs to be a trigger for various reasons...the trigger does a lot). The effect is that NHibernate thinks 2 rows have been deleted instead of 1 (we delete by id). How can I tell NHibernate to ignore the row deleted by the trigger as part of it's error check...or do I have to catch this specific error message?

Hibernate version: 1.2 1.2



Full stack trace of any exception that occurs:EBUG Fatal Error , Source : NHibernate
DEBUG Fatal Error , Method : VerifyOutcomeNonBatched
DEBUG Fatal Error , Date : 3/31/2008
DEBUG Fatal Error , Time : 12:35:27 PM
DEBUG Fatal Error , Computer : ven-dev-web2
DEBUG Fatal Error , Error : Unexpected row count: 2; expected: 1
DEBUG Fatal Error , Stack Trace : at NHibernate.AdoNet.Expectations.BasicExpectation.VerifyOutcomeNonBatched(Int32 rowCount, IDbCommand statement)


Name and version of the database you are using: sql server 2005


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 01, 2008 7:04 pm 
Regular
Regular

Joined: Mon Mar 20, 2006 10:49 pm
Posts: 59
If you are using SQL Server, you can add SET ROWCOUNT OFF at the start of the trigger.

_________________
Mike Abraham


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 01, 2008 7:22 pm 
Newbie

Joined: Tue Apr 01, 2008 8:55 am
Posts: 4
thanks so much. It looks like Set Nocount On works as well. I finally found that in another post.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 02, 2008 7:36 am 
Regular
Regular

Joined: Mon Mar 20, 2006 10:49 pm
Posts: 59
My bad. That's what I meant to say. What I actually said was complete nonsense.

_________________
Mike Abraham


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.