?
Solved

Can a SQL connection have more than one spid?

Posted on 2013-01-31
6
Medium Priority
?
391 Views
Last Modified: 2013-10-09
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
Comment
Question by:remenard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 40

Accepted Solution

by:
lcohan earned 1500 total points
ID: 38840426
"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
 
LVL 10

Expert Comment

by:Matt Bowler
ID: 38842369
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
 

Author Comment

by:remenard
ID: 38855563
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:remenard
ID: 38859812
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
 
LVL 10

Expert Comment

by:Matt Bowler
ID: 39316169
I'm sorry - this slipped off my radar. Do you still need assistance?
0
 

Author Comment

by:remenard
ID: 39560282
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question