[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 401
  • Last Modified:

Can a SQL connection have more than one spid?

Hi,

We are having some connection problems with SQL server 2008.
SQL gets an error and creates a mini dump when we run the program.
One curious question is can a connection only have one spid at a time?
Or can it have multiple and how does it relate to the connection pool.
The other thing is they have been changing the database status from multi user mode to single user and then it is changed back to multiple user.

Were thinking something is happening when it changes between single and multi user mode and the connections in the pool and the active connection.
0
remenard
Asked:
remenard
  • 3
  • 2
1 Solution
 
lcohanDatabase AnalystCommented:
"SQL gets an error and creates a mini dump when we run the program" - for that you need to open a case(call) to the vendor which in this case is Microsoft and send them the DUMP file(s) to be analyzed.

"The other thing is they have been changing the database status from multi user mode to single user and then it is changed back to multiple user.

Were thinking something is happening when it changes between single and multi user mode and the connections in the pool and the active connection. "

when "they" change the database in single user mode then...obviously only 1(ONE) user or ONE connection can be made so...you draw the conclusion. the rest must be terminated somhow and if "they" use the "rollback immediate" as well then yes...you can have lots of issues and should never be done against live DB's in my opinion.

Also a SQL SPID is tied to only ONE connection.
0
 
Matt BowlerDB team leadCommented:
Yes 1 connection = 1 SPID, connection pooling is when multiple application sessions/users are able to reuse existing connections...

What is the error that SQL is returning?
0
 
remenardAuthor Commented:
The error we are getting we trap is after it tried to set the database to multi user mode.

Setting Database to Multi User Mode.
Failed to connect to server .

The error does not seem to trap more information, sorry to say,
checked SQL server logs nothing and checked event logs nothing there either.
The application is C# using Dot Net SQL libraries and our own.

Wish I had more information but all I have at the moment.
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
remenardAuthor Commented:
The other two things I found out is that they have added the service broker to the database.
The database could also have replication running as well in some cases.
I would guess this would make the connections issue more complex.

Would it be better to go through and kill each spid by it self and then change from multi user to single user?  
Not sure that would help clear out the connetions better thatn via the database mode change.

Thanks.
0
 
Matt BowlerDB team leadCommented:
I'm sorry - this slipped off my radar. Do you still need assistance?
0
 
remenardAuthor Commented:
Sorry, we been swamped, looks like it was connection that was created in an application and then passed to another module when it should not of been.
Thanks for you help.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now