views:

29

answers:

3

// MS SQL Server 2008.

My application has several different connections to sql server database (C#, ADO .NET). Each connection uses the same user name and password. Some connections may execute simultaneously.

Is there any problem with that ? Should I add some settings to support that functionality ?

Is there any settings in connection string that allow/restrict simultaneous connections ? Is there any settings in SQL Server that allow/restrict that functionality ?

+1  A: 

No this is normal. Using the exact same connection string also helps with pooling the connections (In the background your connections to the DB are kept open and reused rather than completely closing and opening them).

ck
Why do I get {"\"Impersonate Session Security Context\" cannot be called in this batch because a simultaneous batch has called it."} ?
nik
A: 

No. Absolutely not. I is quite normal (in many scenarios you use an app server that uses a specific logon on the sql server - not one per user) and may have thousand of connections open at the same time.

There is no restrictun, no setting. it is considered normal use.

TomTom
@Tom, maybe there's restrictions in ADO.NET ? I get: {"\"Impersonate Session Security Context\" cannot be called in this batch because a simultaneous batch has called it."} May it be related with same connections ? I use different sqlconnection, sqlcommand and sqldatareader objects ..
nik
Not sure - never seen that. Looks like some impersonation was called manually? Check the SQL side.
TomTom
A: 

MS SQL Server is designed to handle simultaneous connections, no matter which user they come from. I can't see how you'd have a problem, unless the connections are working on the same data.

Kjartan Albertsson
Damn it, two answered while I was writing and logging in. Oh, well..
Kjartan Albertsson
@Kjartan, hi, maybe there's some restrictions in ado.net which don't allow me to do that ?
nik