cancel
Showing results for 
Search instead for 
Did you mean: 

closing mdm connections through java API

Former Member
0 Kudos

hi Guys,

when I am using following command to create a session

sessionId = sessionManager.createSession(userSessionContext,SessionTypes.USER_SESSION_TYPE,userPassword);

I found that in backend(MDM Console) there are 3 connections created.

Two connections with the name "SAP MDM Java API" and 1 with name "SAP MDM Java API (event dispatcher)".

When I am closing connections with the following command

sessionManager.destroySessions(userSessionContext);

the first 2 are getting closed but the one with name event dispatcher is still active. How to close this connection.

Accepted Solutions (1)

Accepted Solutions (1)

former_member205403
Active Contributor
0 Kudos

Hi,

Try this to Terminate Event dispatcher session.

EventDispatcherManager.getInstance().terminateEventDispatcher(serverName);

But it is not recommended to terminate Event Dispatcher instance if your code is running on Java Web AS as this may be shared by other threads

Please go through [Java API guide|http://help.sap.com/saphelp_nwmdm71/helpdata/en/72/d36e1ed3ce43028adc851b8fed5668/MDM_Java_Net_API_Guide.pdf] on page no 24 for code sample to terminate Event Dispatcher.

Regards,

Shiv

Former Member
0 Kudos

hi Shiv,

I tested this code from standalone program and it worked well, This closed the remaing connection with "event dispatcher" name. But you scared me by putting note NOT recommended for running application in java WS . My live application is running in WS and let me try this in DEV environment and see how this behaves.

Meanwhile can you suggest me is there any safe way to close this dispatcher when we are running application in portal. Thanks

Former Member
0 Kudos

hi Guys,

If I release the connections

this.sessionManager.releaseSessions(userSessionContext);

will the "event dispatcher" be killed after a specific timeout. I am going to check this one . I am not finding anything else other than this. Let's see how it goes. Any clue is appreciated. Thanks

former_member205403
Active Contributor
0 Kudos

Hi,

See page no 21, section "Terminating Sessions" in the Java api document. (*I have already given link for the Java API document in earlier post). I think, this will help you.

Regards,

Shiv

Former Member
0 Kudos

hi Siva,

I am already doing the same for destroying the connections. But that doesn't close the event dispatcher. I am doing more investigation. Let's see if I find something. But your document is a very good resource thanks.

former_member205403
Active Contributor
0 Kudos

Hi Pramod,

Please can you share your findings with us on this.. Also want to share below note with you..

"Note 1407733 - How to destroy the event dispatcher connection"

Regards,

Shiv

Answers (0)