Multiple sessions with same name

ansn
ansn Newcomer

Hi

In C#.NET RFA, If I do sess = Session.Acquire("Session1") from multiple independent application components under the same session name, will sess.Release() tear down the other application components sessions before they're done with them? Or should I Release() once for each Acquire() ?

Sincerely

Anders A. Søndergaard

Tagged:

Best Answer

  • umer.nalla
    umer.nalla LSEG
    Answer ✓

    Hi @ansn

    If you refer to the documentation you will note the following:

    Acquire : Acquires a reference to a session with 'name'. If a session already exists with
    'name', then return that session.

    Release : Releases a reference to the session. Once the last reference is released, the session will be removed.

    So, as long as the number of Acquire and Release calls match, the session will not close down until the last reference is release.

Answers

  • Hi @ansn

    If they are used independent processes / applications then they are independent of each other. The name 'session1' is an arbitrary name used to distinguish one session from another within the same application.

  • ansn
    ansn Newcomer

    They are used in the same process. The session name unfortunately also identifies the part of the configuration file to use, so you can't use the same configuration without also using the same session.

    The question is, if I acquire the same session name from different places in the same application, should I Relase() once in total, or once for each Acquire() ?

    The application in question is not RFA centric at all, and only uses it as a generally accessible sub-component.

  • ansn
    ansn Newcomer

    Thanks a bundle! This sentence is missing from the RFANET_DevelopersGuide.pdf and RDMUsageGuideNET.pdf documents that I've been looking through.