Transactions and Threads

  • Thread starter Thread starter Roy Chastain
  • Start date Start date
R

Roy Chastain

Please don't lecture me on the fact that a transaction (BeginTransaction -> Commit) should not last so long that it would be
crossing thread boundaries.

The question is
If I properly protect a SqlConnection object so that only 1 'action' (DataSet fill etc) is happening on it, can it (the
connection) and its associated transaction(s) be used by different threads?
 
yes.

-- bruce (sqlwork.com)



Roy Chastain said:
Please don't lecture me on the fact that a transaction
(BeginTransaction -> Commit) should not last so long that it would be
crossing thread boundaries.

The question is
If I properly protect a SqlConnection object so that only 1 'action'
(DataSet fill etc) is happening on it, can it (the
 
Second opinion: Yes :-)
And, transactions shouldn't last long :-)

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Roy Chastain said:
Please don't lecture me on the fact that a transaction
(BeginTransaction -> Commit) should not last so long that it would be
crossing thread boundaries.

The question is
If I properly protect a SqlConnection object so that only 1 'action'
(DataSet fill etc) is happening on it, can it (the
 
Back
Top