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.  [ 1 post ] 
Author Message
 Post subject: Transactions and concurrency
PostPosted: Tue Aug 08, 2006 4:45 pm 
Newbie

Joined: Tue Aug 01, 2006 12:42 pm
Posts: 11
Hi All,

I have a question about transactions and concurrency. I have an application where several different threads can access different entities that are being persisted (to SQL Server).

I'm planning on using a single ADO connection, and having every thread open up an ISession and call a ISession.BeginTransaction() before modifying any entities. When the thread is done modifying entities it will Flush() the ISession and Commit() the ITransaction.

Does this pattern seem reasonable? Any opinions out there on whether this is a fairly normal way of doing things, or a hideously bad idea would be appreciated :)

If so, does this seem reasonable to do over a single ADO connection? It will result in multiple ISession's over the connection (and the NHibernate docs seem to warn against this) but each ISession is within the context of its own transaction.

I want to use a single ADO connection because it may be that some of these entities will be doing their own hand rolled DB updates/inserts/deletes and I want a single connection to get Commit()'d.

Many thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.