Transactions and Threads

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?
 
B

bruce barker

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
 
M

Miha Markic [MVP C#]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top