Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 766521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T17:03:39+00:00 2026-05-14T17:03:39+00:00

I am implementing a WCF service that uses transaction propagation. The ASP .nET Security

  • 0

I am implementing a WCF service that uses transaction propagation.

The ASP .nET Security model with SQL Server (SqlRoleProvider) is used for authorization. I am using declarative security via the PrincipalPermission attribute, as shown below.

[ServiceBehavior(TransactionIsolationLevel = IsolationLevel.Serializable)]
public class MyService : IMyService
{
    [PrincipalPermission(SecurityAction.Demand, Role = "RoleName")]
    [OperationBehavior(TransactionScopeRequired = true)]
    public void DoSomething()
    {
    }
}

Here’s the question:

What I see is that the authorization check (IsInRole) of the PrincipalPermission is using the propagated transaction as ambient transaction to access the ASP.NET Security database. I do not want that, as this locks the tables in the ASP.NET Security database. Besides, it is conceptually wrong, as it is only an access permission check and totally unrelated to modifications done in the business database.

I understand that I can abandon the declaritive security model and programmatically make the IsInRole check using a new TransactionScope (using TransactionScopeOption.Suppress or TransactionScopeOption.RequiresNew when appropriate), but is it possible to achieve this while retaining the declarative security model?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T17:03:39+00:00Added an answer on May 14, 2026 at 5:03 pm

    Solution:

    I added ‘Enlist=false’ to the connection string to the SQL Security Database; in this way the connection shall not participate in the transaction context.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a Windows Service that uses WCF for communications to it. The service
I am implementing a WCF service (Contract A) that will eventually make calls to
I am implementing a .Net WCF service and I want to apply a namespace
Scenario I've written a distributed application in C# using WCF. It uses Client/Server architecture,
I'm implementing a WCF web service based on WF. This web service consumes other
Implementing a 'sandbox' environment in Python used to be done with the rexec module
I'm implementing a document server. Currently, if two users open the same document, then
I'm writing some software that modifies a Windows Server's configuration (things like MS-DNS, IIS,
I'm implementing an alert type system within my company LAN using WCF callbacks. It
I have a C# WCF basicHttpBinding Streaming WebService. The signature of the method that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.