473,606 Members | 2,381 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Membership & Roles ApplicationName

Asp.Net v2.0
I have created a web application and I am using it from a single website and
database. The web application has different ‘portals’ – each independent and
I am using the Membership & Roles ApplicationName to separate out my
different groups of users within the membership database.

I had been having problems with ‘random’ bugs - as though my Membership
database was 'sharing' information between users and applications rather than
keeping it separate.
I have now come across this article. Is what it is saying about Membership
being a singleton true?
---------------------------------------------------------------------------------
The Membership and Role classes use the singleton design pattern. I did not
instantiate either one in my code to access their ApplicationName properties,
I just used the instance that is automatically created for me. All
applications running on the same web server share the same instances of these
classes, and when one application changes a property, all applications are
affected. How can different applications use separate roles and users without
stepping on each other then?

If your applications are big enough to each have their own web server - or
web farm - there is no problem. You can set the application names in
machine.config and not worry about it. They can share a centralized
membership services database without interfering with each other. You could
set up separate databases to support membership services for each
application, at the loss of some centralization. You could also just use the
stored procedures directly, rather than accessing them through the Membership
and Role methods. This approach lets you set the application name directly,
without reference to the properties.

http://microsoft.apress.com/feature/...e-applications
Nov 28 '07 #1
1 2999

"ePrint" <eP****@discuss ions.microsoft. comwrote in message
news:6A******** *************** ***********@mic rosoft.com...
Asp.Net v2.0
I have created a web application and I am using it from a single website
and
database. The web application has different 'portals' - each independent
and
I am using the Membership & Roles ApplicationName to separate out my
different groups of users within the membership database.

I had been having problems with 'random' bugs - as though my Membership
database was 'sharing' information between users and applications rather
than
keeping it separate.
I have now come across this article. Is what it is saying about
Membership
being a singleton true?
No, it is absolute crap. Static methods are not the same as a Singleton.

Even if it were true that Roles are shared amongst all applications in the
database (it isn't), that would not be a Singleton pattern either.

This is the table design for the aspnet_Roles table:

/****** Object: Table [dbo].[aspnet_Roles] Script Date: 11/28/2007 15:05:17
******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFI ER ON

GO

CREATE TABLE [dbo].[aspnet_Roles](

[ApplicationId] [uniqueidentifie r] NOT NULL,

[RoleId] [uniqueidentifie r] NOT NULL DEFAULT (newid()),

[RoleName] [nvarchar](256) COLLATE SQL_Latin1_Gene ral_CP1_CI_AS NOT NULL,

[LoweredRoleName] [nvarchar](256) COLLATE SQL_Latin1_Gene ral_CP1_CI_AS NOT
NULL,

[Description] [nvarchar](256) COLLATE SQL_Latin1_Gene ral_CP1_CI_AS NULL,

PRIMARY KEY NONCLUSTERED

(

[RoleId] ASC

)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]

GO

ALTER TABLE [dbo].[aspnet_Roles] WITH CHECK ADD FOREIGN KEY([ApplicationId])

REFERENCES [dbo].[aspnet_Applicat ions] ([ApplicationId])

------------------

See the ApplicationID? That means a role is used once per application.
Without a custom membership provider, you will not share info.

Not sure of the Phantoms you are getting. Have you set the config files up
correctly for them to be different apps?

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************** *************** *************** ****
| Think outside the box!
|
*************** *************** *************** ****
Nov 28 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1228
by: Demetri | last post by:
I have several questions regarding the Membership and Roles mechanism in ASP.Net 2.0. 1. In the box, it comes with SqlMembershipProvider, which uses SQL Express 2005. What if I want it to use SQL Server 2005 Enterprise (not express) instead? I'm really hoping I don't have to write my own MembershipProvider to accomplish this. 2. My users have more information about them than the in the box data. For example, I will need to know what...
0
6234
by: Anonieko | last post by:
A lot of times, web hostings for ASPNET 2.0 will offer only MS Access DB for database for basic plan, a question often asked is how can I use the membership services, role, web parts services, etc for this MS Access db. Well, microsoft offers a download sample. Instructions are below. HOW TO USE MS ACCESS DB FOR ASPNET APPLICATION SERVICES ( membership, profile, roles, etc providers)
0
1029
by: awrigley | last post by:
Hi An app that was chuntering away quite happily to itself had roles added to it. Just two: Admins and Subscribers. However, I seem to have mucked up when assigning the role provider in the Web.config file, as I just left the default, whereas in members, this was modified to use our online database (details below). The pernicious effect was two fold:
0
1389
by: =?Utf-8?B?QV9SZXB1YmxpY2Fu?= | last post by:
This is a portion of my Web.config file: <system.web> <membership defaultProvider="SqlProvider"> <providers> <clear/> <add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="SqlServices" applicationName="CollegeRepublicans"
3
2011
by: Michael Lang | last post by:
Hi there, I have a web application that works fine on my local dev machine. However I'm having less success on my hosting environment. When I detach the database for this site, copy it to my hosting environment and attach it through their interface, I can connect to the database in my hosting environment through the SQL Management studio, see all stored procs, functions, tables, and the data in the tables I had entered on my local dev...
2
2765
by: GaryDean | last post by:
My ASP.Net application, that uses the SQL Membership Provider, runs fine on my development box (server2003) as long as I use the standard provider. But, in anticipation of deployment to other servers I am attempting to register another provider instance. I'm not sure this is the right deployment choice but I haven't found any guidelines on how to best deploy apps using the SQL Membership provider. I first attached...
1
2940
by: =?Utf-8?B?aGZkZXY=?= | last post by:
Hello, I have a web application that makes use of the SQL Membership and Role providers. My app has admin screens to manage users (membership), roles, and supplementary user data. I have just deployed the application to a production server. My Question: How do I create the initial Admin role and user in the clean/unpopulated database that has the Membership and Role schema on this production server?
1
2371
by: =?Utf-8?B?ZVByaW50?= | last post by:
Asp.Net v2.0 I have created a web application and I am using it from a single website and database. The web application has different ‘portals’ – each independent and I am using the Membership & Roles ApplicationName to separate out my different groups of users within the membership database. I had been having problems with ‘random’ bugs - as though my Membership database was 'sharing' information between users and...
1
1913
by: =?Utf-8?B?VGhvbWFz?= | last post by:
I'm running into a bizzare sitution with the SqlMembershipProvider. I am using a SqlMembershipProvider and SqlRoleProvider. The are each set to a different applicationName. like so: <roleManager defaultProvider="MyRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".OURSPIFFYROLES" cookieTimeout="30" cookiePath="/"
0
8016
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7955
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8440
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8431
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8306
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6773
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5966
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5466
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3937
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.