New Posts New Posts RSS Feed: How can refresh the MainEntityManager after new login ?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Forum LockedHow can refresh the MainEntityManager after new login ?

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

Joined: 18-Dec-2007
Posts: 11
Post Options Post Options   Quote aladdin Quote  Post ReplyReply Direct Link To This Post Topic: How can refresh the MainEntityManager after new login ?
    Posted: 19-Jan-2009 at 9:16am
Hi.Happy new year.

my question is about EntityManagerService.

How can refresh the MainEntityManager after new login ?
       ...my steps
       PersistenceManager  pManager = new PersistenceManager(true, "extention");
       pManager.Login(new LoginCredential("admin2", "password2", "")
       ...after success login the DefaultManager and the MainPm.Manager must look the new manager
       PersistenceManager.DefaultManager = pManager;
       MainPm.Initialize();

because the MainEntityManager hold the old PersistenceManager from the initialization.

It is the right way to remove the MainEntityManager

       EntityManagerService.RemoveEntityManager (MainEntityManager ) from the servise

and add it again
       AddNewEntityManager<MainEntityManager>(
                                   EntityManagerNames.MainEntityManager, MainPm.Manager, false);

thanks
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down