Print Page | Close Window

DevForce LoginManager

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=110
Printed Date: 15-May-2025 at 12:19pm


Topic: DevForce LoginManager
Posted By: Darren
Subject: DevForce LoginManager
Date Posted: 09-Jul-2007 at 5:34am
I have followed the Security Tutorial and Successfully implemented Logins with my application.
 
I have a Mdi Parent which opens up after the login. The MDIParent does not use any PersistenceManagers at all. The MDIParent is basically a switchboard form for accessing other forms of the application.
 
The MDIParent has a few MDIChild Forms which have there own persistence managers. When i open any of the Child Forms i get this error:
 
 
"Failed to login before using PersistenceManager or submitted null credentials."
 
 
I guess this is because i logged in under Persistence.DefaultManger.
 
I have to use seperate PM's for each child as it is the way my app has been designed , i cannot change it to use the one PM.
 
I noticed this comment in the LoginManager Class:
 
 
"Because one must login on every new PM before that PM can access a data source if that PM might have a different extension, you may have to give the SecureUser its own datasource key and route all extensions with this key to the database that holds SecureUser"
 
Is this what i should do and how do i acheive this?
 
Is there a way to solve this issue.
 
Thank You
 



Replies:
Posted By: davidklitzke
Date Posted: 09-Jul-2007 at 12:58pm
Darren,
 
Because you have a LoginManager, each and every one of your PersistenceManagers will need to do a Login.
 
You are correct that if you had decided to use a single PersistenceManager for your entire application, you would not have encountered this exception.
 
If all PersistenceManagers are using the same database and connection string, I would simply do a PersistenceManager.Login(aCredential) where "aCredential" is the credential you used for your initial login (using code borrowed from the Security tutorial).  This will avoid having the user fill out the Login Form for each and every MDI form.
 
Since you have multiple PersistenceManagers, you should be aware that any change made using one PersistenceManager will not be seen by any other PersistenceManager (until and unless you do a SaveChanges).  You should also be aware that if you save the same kind of entiy from two different forms, you may experience concurrency conflicts.
 
David
 
 


Posted By: Darren
Date Posted: 10-Jul-2007 at 2:26am
Thanks David ,
 
My application is working as it should.
 
Thank you again



Print Page | Close Window