Tell me more ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm using SQL Server 2008 Sp3

Lately I'm having errors in the SQL Logs:

Error: 18059, Severity: 20, State: 1.

The connection has been dropped because the principal that opened it subsequently 
assumed a new security context, and then tried to reset the connection under its 
impersonated security context. This scenario is not supported. See "Impersonation 
Overview" in Books Online.

I have find via PROFILER the relevant originated server and application. I googled it and found someone that says that we need to change the connection pooling in the application's Connection String.

The link: http://nishantrana.wordpress.com/2008/12/12/the-connection-has-been-dropped-because-the-principal-that-opened-it-subsequently-assumed-a-new-security-context-and-then-tried-to-reset-the-connection-under-its-impersonated-security-context-this-s/

Below is the relevant Web.Config file that in charge on the connection string:

<?xml version="1.0"?>
<appSettings>
    <add key="Main.ConnectionString" value="Data Source=db-002\db2;Initial Catalog=APPDB;TRUSTED_CONNECTION=YES"/>
    <add key="ConnectionHash" value="==QMr1meolHO3YWdTNFOzcTO"/>
    <add key="Database" value="[APPDB]"/>
    <add key="UseApprole" value="True"/>
</appSettings>

I changed it to the following in our TEST env:

<?xml version="1.0"?>
<appSettings>
    <add key="Main.ConnectionString" value="Data Source=db-002\db2;Initial Catalog=APPDB;TRUSTED_CONNECTION=YES;Pooling=false"/>
    <add key="ConnectionHash" value="==QMr1meolHO3YWdTNFOzcTO"/>
    <add key="Database" value="[APPDB]"/>
    <add key="UseApprole" value="True"/>
</appSettings>

I've reset the application, services and IIS. Checked the application and it works.

For some time I didn't receive these errors anymore, but after 3 hours they reverted.

Can anyone give me an idea what can I do?

Thanks in advance,

Roni.

share|improve this question
Are you doing any impersonation on the SQL Server side? – Jon Seigel Feb 15 at 15:53
1  
Is the application doing impersonation within the .NET code? – mrdenny Feb 15 at 16:15

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.