Print Page | Close Window

IEntityLoginManager Help

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3574
Printed Date: 13-May-2026 at 2:59am


Topic: IEntityLoginManager Help
Posted By: matt.cavagnaro
Subject: IEntityLoginManager Help
Date Posted: 09-Aug-2012 at 2:34pm
I've recently begun experimenting with a class that implements IEntityLoginManager in a Silverlight 5 application using DevForce 6.1.7.1.

I've done a lot of reading but have not been able to find much, if any, information about the following two questions:
  1. I've run into an issue where I cannot call Authenticator.Instance.LogoutAsync from the client when the user navigates away or closes the browser. Is there any advice how to accomplish a log out for an IAuthenticationContext in a situation such as this?
  2. I've read that sessions will be closed if left inactive for long enough. Is there a way to intercept when a session expires on the server so that other clean-up can be done? Also, is there a way to view all log-ins to the EntityServer?



Replies:
Posted By: katit
Date Posted: 10-Aug-2012 at 9:40am
Somebody will help with explaining how to view logins on server, but for other questions read my recent topic:
 
http://www.ideablade.com/forum/forum_posts.asp?TID=3513&title=upgraded-to-617-from-614-issues-migrating-multidomain-authentication-code - http://www.ideablade.com/forum/forum_posts.asp?TID=3513&title=upgraded-to-617-from-614-issues-migrating-multidomain-authentication-code


Posted By: DenisK
Date Posted: 10-Aug-2012 at 1:36pm
Hi matt.cavagnaro,

1. You can capture the Browser unload event using JavaScript and pass it on to the SL plug in. See  http://mark.mymonster.nl/2009/02/28/integration-of-browsers-unloading-with-silverlight/ - http://mark.mymonster.nl/2009/02/28/integration-of-browsers-unloading-with-silverlight/  for an example.

2. There's currently no way to intercept session expiration on the server. If you want to do your custom clean ups, you can implement that in your Logout method. I'm curious though, what clean ups are you trying to do as the EntityServer should never keep state ?

3. Debug Log ( http://drc.ideablade.com/xwiki/bin/view/Documentation/debug - http://drc.ideablade.com/xwiki/bin/view/Documentation/debug ) provides one way to view this. You can also implement your own custom logger ( http://drc.ideablade.com/xwiki/bin/view/Documentation/custom-logger - http://drc.ideablade.com/xwiki/bin/view/Documentation/custom-logger ) so you can log any login process in your IEntityLoginManager implementation.


Posted By: matt.cavagnaro
Date Posted: 13-Aug-2012 at 7:01am
katit, thanks for the link. There is some informative stuff in there, but not quite what I was looking for.
 
Denis, we have a custom concurrency system we're trying to get to release locks when the user becomes inactive. I saw the Login Manager while reading DevForce documentation and thought it might be able to satisfy our needs. But if there's no way to intercept session expiration it seems like this is a lost cause. Do you have any suggestions for this?
 
Also, not sure how helpful the Debug Log will be here.


Posted By: mgood
Date Posted: 13-Aug-2012 at 1:56pm
What you are trying to solve here is the #1 reason to never use pessimistic currency control in a web environment, the other is the performance implications. It is very hard to reliably clean up pessimistic locks in a web environment. Even if DevForce would allow you to intercept the session expiration, everything would fall apart once you start clustering servers and a user starts a session on one server, then continues it on another server. Once the session expires on the first server it may accidentally clean up valid locks. DevForce doesn't support session replication to avoid this issue.
 
The solution to this problem is optimistic concurrency control, which is fully supported in DevForce.
 
http://drc.ideablade.com/xwiki/bin/view/Documentation/save-concurrency - http://drc.ideablade.com/xwiki/bin/view/Documentation/save-concurrency


Posted By: matt.cavagnaro
Date Posted: 14-Aug-2012 at 10:44am
mgood, unfortunately pessimistic concurrency is the easier route to go for our app and is not something we can easily back out of at this time. Thank you for your input, I'll keep DevForce's concurrency solution in mind for the future.


Posted By: katit
Date Posted: 14-Aug-2012 at 10:54am
We had pessimistic concurrency in one app. You can't reliably do anything like this in Web environment. In our case it worked because in case of connection loss or user error (close browser) there was option to "unlock" records using managers password. Things like this can work..



Print Page | Close Window