-->
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: SQL Server Triggers Freaking NHibernate out
PostPosted: Mon Oct 24, 2005 3:31 pm 
Hi everyone,

I am creating a system that tracks the real time location of people and devices within a medical facility. I have two relevant tables in SQL Server to maintain the location state. One table has the real time location of the entities, real time, one record per entity per location. The other subordinate table is a location history table. I have a SQL Server on delete trigger that inserts a history record when the entity location record is deleted.

Here is the problem, SQL Server includes the record row counts that the trigger changed with the delete of the primary location table. So NHibernate is expecting a delete row count of 1 and SQL Server is returning a row count of 2. Which is causing the NHibernate transaction to fail.

Anyone have any experience getting SQL Sever triggers to work and play well with NHibernate?


Top
  
 
 Post subject:
PostPosted: Tue Oct 25, 2005 2:36 am 
Newbie

Joined: Wed Sep 14, 2005 5:07 pm
Posts: 6
try adding this to your trigger's body (within the begin and end)
Code:
SET NOCOUNT ON
SET NOCOUNT OFF


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Thu Feb 16, 2006 4:52 am 
Newbie

Joined: Wed Jan 11, 2006 8:24 am
Posts: 5
I had the same problem and your solution is working well...
I credit you ;-)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 16, 2006 7:13 am 
Senior
Senior

Joined: Thu Aug 25, 2005 3:35 am
Posts: 160
ehhe, then you should rate his post as being helpful ;-)


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.