473,409 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

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 2984

"ePrint" <eP****@discussions.microsoft.comwrote in message
news:6A**********************************@microsof t.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_IDENTIFIER ON

GO

CREATE TABLE [dbo].[aspnet_Roles](

[ApplicationId] [uniqueidentifier] NOT NULL,

[RoleId] [uniqueidentifier] NOT NULL DEFAULT (newid()),

[RoleName] [nvarchar](256) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

[LoweredRoleName] [nvarchar](256) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL,

[Description] [nvarchar](256) COLLATE SQL_Latin1_General_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_Applications] ([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
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...
0
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 ...
0
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...
0
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"...
3
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...
2
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...
1
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...
1
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...
1
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...
0
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...

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.