Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27159

VS 2012 [RESOLVED] Is MSSQL's SCOPE_IDENTITY() thread safe?

$
0
0
Hello,

I'm currently developing a Windows Service that will serve as an application server. I'm using the Task Parallel Library to launch tasks in separate threads and most of these tasks are calls to stored procedures in a SQL Server database. My questions is two-tier:

  • What is the preferred connection method? Create a connection for each task or use the same connection with MultipleActiveResultSets=True?
  • is MSSQL's SCOPE_IDENTITY() thread safe when multiple threads are using the same connection?

Viewing all articles
Browse latest Browse all 27159

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>