Skip to Content
0
Former Member
Apr 26, 2012 at 01:06 PM

MDM DotNet API: Invalid connexion timeout

46 Views

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!