Skip to Content
author's profile photo Former Member
Former Member

MDM DotNet API: Invalid connexion timeout

Hi,

We use MDM dotnet API in our web application to connect to MDM server and to retrieve data.

Below is the class witch we use to manage MDM connexions and sessions:

/// <summary>

/// A class allowing to manage MDM user session.

/// </summary>

internal abstract class MdmContextManager

{

private static UserSessionContext _context;

/// <summary>

/// Returns the default MDM UserSessionContext

/// </summary>

internal static UserSessionContext DefaultContext

{

get {

if(_context == null)

_context = new UserSessionContext(MdmConfiguration.SERVER_NAME, MdmConfiguration.REPOSITORY_NAME, MdmConfiguration.DEFAULT_USER_REGION ,MdmConfiguration.DEFAULT_USER_NAME );

return _context;

}

}

/// <summary>

/// Open a MDM user session for the default UserSessionContext

/// </summary>

/// <returns>a string containing the MDM session identifier</returns>

internal static string OpenSession()

{

return SessionManager.Instance.createSession(DefaultContext, SessionTypes.USER_SESSION_TYPE, MdmConfiguration.DEFAULT_USER_PASSWORD);

}

/// <summary>

/// Destroy the MDM user sessions for the default UserSessionContext

/// </summary>

internal static void DestroySessions()

{

SessionManager.Instance.destroySessions(_context);

}

}

And when I need to connect to MDM I use OpenSession() I process data and finnaly I call DestroySession().

My problem is when there is a period of application inactivity (between 45min and 1h) and I call OpenSession it issue with this exception "

SessionException"

And the error message is :

com.sap.mdm.session.SessionException: Can not create user session ''<server=XXXXX serverUser=Admin repository=XXXXX region=French [FR] user=XXXX>'' ---> com.sap.mdm.commands.CommandException: com.sap.mdm.net.ConnectionException: System.IO.IOException: Impossible de lire les données de la connexion de transport : Une connexion existante a dû être fermée par l'hôte distant. ---> System.Net.Sockets.SocketException: Une connexion existante a dû être fermée par l'hôte distant

à System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)

à System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

--- Fin de la trace de la pile d'exception interne ---

à com.sap.mdm.intern.net.ConnectionImpl.send(Int32 sendBand, Byte[] command, Int32 size)

à com.sap.mdm.intern.net.ReservedConnection.send(Int32 sendBand, Byte[] command, Int32 size)

à com.sap.mdm.intern.protocol.manual.AbstractProtocolCommand.execute()

à com.sap.mdm.intern.protocol.manual.AbstractProtocolCommand.execute()

à com.sap.mdm.commands.CreateUserSessionCommand.execute()

à com.sap.mdm.commands.CreateUserSessionCommand.execute()

à com.sap.mdm.session.SessionManager.createUserSession(UserSessionContext ctx, String password)

--- Fin de la trace de la pile d'exception interne ---

à com.sap.mdm.session.SessionManager.createUserSession(UserSessionContext ctx, String password)

à com.sap.mdm.session.SessionManager.innerGetSession(IDictionary sessionCache, MdmSessionContext ctx, Int32 sessionType, String password)

à com.sap.mdm.session.SessionManager.createSession(MdmSessionContext ctx, Int32 sessionType, String password)

I thought that it was due to a bed MDM server configuration, so I modified this one "Inactive Client Timeout" from 30 minutes to 2 minutes

I restarted the server, but I still have the same error 😔

Any suggestions?

Thanks!

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Apr 30, 2012 at 11:44 PM

    Hello Rémi,

    I'm not a MDM expert, however have you tried to change the "inactive client timeout" to 90 minutes?

    To me it seems that you should increase this timeout, and not decrease it.

    I hope this helps.

    Regards,

    Isaias

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.