cancel
Showing results for 
Search instead for 
Did you mean: 

Logoff session problem

Former Member
0 Kudos

Hi all,

When I'm testing my java code, I notice one detail today. Every time I launch the application, the session I open stay alive on BO (and so for the same user, I have a number of session which increasing).

I'm using the Rebean SDK for the webi report and I'm doing a "closeDocument()" on the document after my work and a connection "logoff()" and a reportEngine.close() and reportEngines.close().

Does we need a gap of time between the end of the application and the moment when the session disappear? Is it normal? Do I need to do something more to close the session I've just used?

Thanks in advance !

And once again, Happy New Year

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Use this code-

ILogonTokenMgr tokenMngr = session.getLogonTokenMgr();

return tokenMngr.createWCAToken(computerName, validMinutes, validNumOfLogons);

computer name could be an empty string,valid minutes will be the time for which you want the ession to be active and valid num of logons will give the number of times you can login with the session.This will not increase the count of sessions in BO and when you are logging off use this-

ILogonTokenMgr tokenMngr = session.getLogonTokenMgr();

tokenMngr.releaseToken(loginToken);

This will release token.

Former Member
0 Kudos

I suppose that the "loginToken" object used in "tokenMngr.releaseToken(loginToken);" is the object returned by the previous line : tokenMngr.createWCAToken(computerName, validMinutes, validNumOfLogons); ?

Former Member
0 Kudos

yes,that is right you just need to take that token and release it.

Former Member
0 Kudos

Hi,

I've tried you're method, getting the token and release it before logoff the session.

But I always see a session opened in the Central Management with the used user. If I relaunch the code, another session is opened and is keeping alive during a long time (more than 10 minutes).

I tried to create a token with only one minutes and one number of logon max but it's doing the same thing :s

aasavaribhave
Advisor
Advisor
0 Kudos

when you call logon() in your code that consumes 1 enterprise session. In addition for everyusage of token it consumes 1 session. I don't now how your application workflow is, but if you are redirecting to InfoView and clicking logoff button in InfoView it will release only the additional session consumed by token, original session created by logon() in your code still needs to be released by calling logoff explicitly.

If you can explain the workflow in your code, it would be easier to find why and where sessions get created and don't release.

Former Member
0 Kudos

Hi,

With what you explain, I relook to the code and change some object encapsulation and now when I'm procced to the logoff, the session is well closed !

Thanks for your help.

Answers (1)

Answers (1)

aasavaribhave
Advisor
Advisor
0 Kudos

By connection logoff() you mean you call logoff() on IEnterpriseSession object, correct? That should release the session almost instantaneously.

Are you using logon token, if yes then can you also call release token? May be just test logon and logoff on Enterprise and see if it creates and releases the session.