on 10-14-2008 7:23 PM
From the Java APIs, I am using Destroy session command in portal to close the MDM Connection.
public void destroySession() throws MdmException{
METHOD="destroySession";
if(simpleConnection!=null){
DestroySessionCommand destroySessionCommand=new DestroySessionCommand(simpleConnection);
try {
if(userSession!=null && repositorySession!=null){
destroySessionCommand.setSession(repositorySession);
destroySessionCommand.execute();
destroySessionCommand.setSession(userSession);
destroySessionCommand.execute();
}
} catch (CommandException e) {
throw new MdmException(e.getMessage(),METHOD,CLASS_NAME);
}
userSession=null;
repositorySession=null;
closeConnection();
}
}
But when I check in MDM Console, I am seeing quite a large number of API connections/users logged in from Java API.
Any idea/pointer to the issue.
I have faced the similar issue on SP4/5 and now on 6.
Is there any thing extra that i need to do?
What are the best practices involved here?
What is the best way to close the session and the connection so that the API connection closes properly?
... Wanted to add one thing: When i unload / load the repository, quite a substantial number of such entries remain intact in Console.
Regards,
Nitin
Edited by: Nitin Mahajan on Oct 14, 2008 8:25 PM
Hi Nitin,
Check SAP Note 1154389
It says for every session created there should be corresponding DestroySessionCommand.
Regards,
Jitesh Talreja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yea i guessed that, seems it would need coding around connection pools or shall i say, i wil have to handle the session in the code which i don't want to do. The current application is not very performance intensive.
What i have seen in standard SAP content for the first connection to MDM, 2 connection objects are opened up. and when you close the window, 1 connection remains. seems one that remains is a connection opened with user session. when this session gets killed, the cde is probably to kill all the sessions with the same user id. Don't know.
Might have to dig a little more.
~Nitin
The code looks ok to me assuming you always have both a user session and repository session. For example if you only have a user session and repositorySession is null the code in the if statement won't execute and the user session will stay connected.
I'd also check where and how you create connections. Watch the console closely as you start and run your application, verify the connections are created at the correct times and the correct number are created. Verify they are destroyed when the application exits. Also any abnormal exits like null pointer exceptions probably won't clean up connections.
Hope this helps,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The connections you see after the repository has been unloaded are repository sessions. User sessions get cleaned up on an unload, but repository sessions only get cleaned up when the repository is unmounted. I would guess your application is making too many repository sessions so your code loses its reference to the session and they are never cleaned up. SP6 patch 3 has a timeout setting that can automatically remove connections after a certain time period.
-Greg
Hi Nitin,
Which MDM Patch you are on. There is an issue with SP06 Patch2. It keeps invalid connections. Your issue looks the same. Look for the Note No : 1245174
Regards,
Amol
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.