cancel
Showing results for 
Search instead for 
Did you mean: 

Closing MDM Connections in Portal

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Nitin,

Check SAP Note 1154389

It says for every session created there should be corresponding DestroySessionCommand.

Regards,

Jitesh Talreja

nitin_mahajan2
Contributor
0 Kudos

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

Greg_Austin
Active Participant
0 Kudos

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

nitin_mahajan2
Contributor
0 Kudos

I understand what you are saying, but what would be the explanation for MDM not being able to clean up the connections/logged in users even after unload/load?

Regards,

Nitin

Greg_Austin
Active Participant
0 Kudos

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

Former Member
0 Kudos

Hi,

So it means that there is no another way by which we can remove these sessions/Connections OR is there any other way by which we can remove the same.

It would be really helpful, If anyone has found the answer as i am also facing the same problem.

Thanks in Advance,

Shruti.

nitin_mahajan2
Contributor
0 Kudos

I feel it is an issue but don't know the resolution. I think it would be better to code for connection pooling in the code.

Closing the thread.

Former Member
0 Kudos

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

nitin_mahajan2
Contributor
0 Kudos

Thanks Amol,

My issue is with the connections on the MDM console side and not on the Portal Connection Pool.

~Nitin