Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetSession should return null when the session does not exist #62

Open
GoogleCodeExporter opened this issue Aug 26, 2015 · 2 comments
Open

Comments

@GoogleCodeExporter
Copy link

If I call the GetSession method (in class TerminalServicesServer) with an 
invalid session as argument, the return value is a TerminalServicesSession. If 
I try to retrieve the value of a property, an exception is thrown.

Please change your code that this method returns null or throws an exception if 
the session does not exist.

Cassia Version: latest (2.0.0.60)

Original issue reported on code.google.com by surf...@gmail.com on 13 Sep 2012 at 2:12

@GoogleCodeExporter
Copy link
Author

I can see how this might be confusing. Most of the session properties are lazy 
loaded, which is where this originates, though it's rarely a problem when 
GetSessions() is called. How are you using GetSession() in your app? (Or, how 
would a solution to this make your life easier?)

Original comment by danports on 14 Sep 2012 at 2:51

@GoogleCodeExporter
Copy link
Author

I see, the lazy loading is causing the problem.

I use Cassia in the following situation:
The ServiceBase class provides methods to receive session notification events. 
When a sessionlogoff event or a remote disconnect event is received it may be 
possible that the session is at this point already gone. Especially when the 
server is under heavy load the event gets called too late and then I get an 
exception when I try to retrieve information about the session using Cassia.

However, there is no sense in returning an instance of a 
TerminalServicesSession when there is no session at all!

Original comment by surf...@gmail.com on 14 Sep 2012 at 8:21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant