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: NH + SqlDataAdapter: Timeout expired
PostPosted: Mon Dec 17, 2007 10:57 am 
Beginner
Beginner

Joined: Mon Mar 26, 2007 5:47 am
Posts: 22
Hi,

In our proejct we have the main part that is doen by NHibernate, but a small part of the information is selected by an other dll, which doesn't use NHibernate but simpel SqlDataAdapters.

This works, but not in every situation. When I have a SqlDataAdapter-Select inbetween an NHibenrate Transaction, I get this Timeout-exception. which is totally logical because NHibernate locks these tables.


The possbile solutions I see:
- putting the external dll on NH (but can't be done now)
- specifying another lock-type for NH so 'outside' selects o nthe same tables will be able during an NH-transaction. BUT: HOW?
- giving the external dll the same connection and putting it in the same transaction as NH uses. BUT: HOW?


Any help woudl be really appreciated...


Thansk a lot in advance,


Pieter


Hibernate version: 1.2


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 17, 2007 1:25 pm 
Expert
Expert

Joined: Fri May 13, 2005 11:13 am
Posts: 292
Location: Rochester, NY
If you can get at the underlying SqlCommand in the SqlDataAdapter, you should be able to enlist it into the ITransaction.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 19, 2007 4:46 am 
Beginner
Beginner

Joined: Mon Mar 26, 2007 5:47 am
Posts: 22
And how should I do this exactly?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 19, 2007 5:15 am 
Beginner
Beginner

Joined: Mon Mar 26, 2007 5:47 am
Posts: 22
Ok I found it already here: http://www.lostechies.com/blogs/joshua_lockwood/archive/2007/04/10/how-to-enlist-ado-commands-into-an-nhibernate-transaction.aspx

This is really a great feature!! Thanks a lot in advance! :-)


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.