New Posts New Posts RSS Feed: DevForce LoginManager
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

DevForce LoginManager

 Post Reply Post Reply
Author
Darren View Drop Down
Newbie
Newbie
Avatar

Joined: 06-Jul-2007
Location: United Kingdom
Posts: 23
Post Options Post Options   Quote Darren Quote  Post ReplyReply Direct Link To This Post Topic: DevForce LoginManager
    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
 
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post 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
 
 
Back to Top
Darren View Drop Down
Newbie
Newbie
Avatar

Joined: 06-Jul-2007
Location: United Kingdom
Posts: 23
Post Options Post Options   Quote Darren Quote  Post ReplyReply Direct Link To This Post Posted: 10-Jul-2007 at 2:26am
Thanks David ,
 
My application is working as it should.
 
Thank you again
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down