Linked Questions

0 votes
0 answers
52 views

Local temporary table(SQL Server) not dropping automatically after method execution with JdbcTemplate but works with NamedParameterJdbcTemplate?

I am trying to execute a native query in which I've created local temporary table. My front end call an Api and a method executes that query. If I call that method again, sometimes i get, object(#...
aakash singh's user avatar
1 vote
1 answer
658 views

System.Data.SqlClient.SqlException after CREATE/ALTER/PRINT

I'm coming from 2 other questions, and am trying to understand why this exception happens. Entity Framework seed -> SqlException: Resetting the connection results in a different state than the ...
pitermarx's user avatar
  • 908
9 votes
2 answers
11k views

How to grant db_owner permissions to an application role?

How can grant all the rights and privileges of the db_owner fixed database role to an application role? Short Version The command: GRANT CONTROL ON [DatabaseName] TO [ApplicationRoleName]; would ...
Ian Boyd's user avatar
  • 251k
2 votes
1 answer
1k views

Sql Server 2014 sp_reset_connection behavior inside transaction

What is the behavior of sp_reset_connection when it is run inside a transaction? I am looking for clarification so I can decide if I need to restructure my code, or if I can leave it as is. I have a ...
James Ross's user avatar
9 votes
1 answer
3k views

Is it safe to use a session-owned SQL Server sp_getapplock with EF6 DbContexts?

I am wondering about the risks/safety of using an EF context with sp_getapplock and the session owner type. Based on the docs, my understanding is that a session owner means the lock will be released ...
Josh's user avatar
  • 7,177
5 votes
1 answer
2k views

Connection pools and releasing temporary tables on return

I'm using MySQL's temporary tables with connection pooling. Normally, temporary tables created in a session stay in that session and are dropped when the connection is closed. However, since I'm ...
antak's user avatar
  • 20.1k
0 votes
1 answer
5k views

How do I resolve mssql resetting connections

I keep getting this error randomly when I test an application with mssql and don't have an idea of what I can do to correct the issue. Exception [EclipseLink-4002] (Eclipse Persistence Services - 2....
Bwire's user avatar
  • 1,181
0 votes
0 answers
391 views

Glimpse Sql Tab Connections and DbContext instants

in an action I've instantiated my DbContext through a using block: using(var context = new DbContext()) { //EF codes } inside the block, I'm making several queries to the database. I thought ...
mohsen dorparasti's user avatar
1 vote
1 answer
5k views

IIS SQL Server: Connection Pool: Why are new connections made instead of reusing existing connections?

During app loading a single user will add 10 connections to the pool. Then if I load another user I will have a total of 20 connections. Why are new connections being added to the pool instead of ...
James Grigley's user avatar
14 votes
1 answer
3k views

SqlConnection vs Sql Session. Do their lifetimes coincide?

I want to apply some sql-session level settings for certain processes in my c# app. For instance, I want to set DEADLOCK_PRIORITY for some background processes to LOW. The questions are: If I open ...
Artur Udod's user avatar
  • 4,605
2 votes
5 answers
3k views

Using Block with Stored Procedures

i am trying to get used to working with "using" blocks in C#, but i'm having a hard time understanding when i should be using them. here is an example. my original code, without the using block: ...
Madam Zu Zu's user avatar
  • 6,487
69 votes
4 answers
14k views

SQL Server: Isolation level leaks across pooled connections

As demonstrated by previous Stack Overflow questions (TransactionScope and Connection Pooling and How does SqlConnection manage IsolationLevel?), the transaction isolation level leaks across pooled ...
usr's user avatar
  • 170k
4 votes
1 answer
3k views

Disabling sp_reset_connection

Due to some problems I'm experiencing, I am experimenting with connection pooling in .NET Framework 4. Using SQL Profiler, I can see that every time a connection is fetched from the connection pool, ...
Nitramk's user avatar
  • 1,562
13 votes
4 answers
18k views

Can I stop sp_reset_connection being called to improve performance?

My profiler trace shows that exec sp_reset_connection is being called between every sql batch or procedure call. There are reasons for it, but can I prevent it from being called, if I'm confident that ...
Rory's user avatar
  • 41.1k
48 votes
2 answers
29k views

What does sp_reset_connection do?

sp_reset_connection seems to be called by SQL Server connection pooling, to ensure that connections reused from the pool have most of their settings reset. Does anyone know exactly what it does and ...
Rory's user avatar
  • 41.1k