locked
What happens to static variables used in helper classes, when orchestration gets suspended? RRS feed

  • Question

  • What happens to static variables used in helper classes, when orchestration gets suspended? Do they become null?
    Thursday, March 22, 2018 8:14 AM

All replies

  • Hi ak47,

    No, they should hold their value. This really has nothing to do with BizTalk, but the way .Net works. Static variables are held in the current CLR Runtime (that is - the current BizTalk host instance that is run as a NT Service).

    Br,

    Leo


    Did my post help? Please use "Vote As Helpful", "Mark as answer" or "Propose as answer". Thank you!

    • Proposed as answer by Leo Erlandsson Thursday, March 22, 2018 8:21 AM
    Thursday, March 22, 2018 8:21 AM
  • Thank you Leo for quick help. That is my understanding too. But i see a weird behaviour:

    I have static variable marked threadstatic in a helper class. I initialize at the begining of the class this variable to an instance.

    And in another static method, i make use of this static variable.

    A biztalk map, makes use of the above static method. Map is invoked within the orchestration

    It happened once the orchestration suspended. When i resumed, it gave object reference error for the particular static variable. Since it is marked threadstatic i expect the variable to have an instance in all the threads spawned by the host instnace running the orchestration.


    • Edited by a.k.4.7 Thursday, March 22, 2018 8:27 AM
    Thursday, March 22, 2018 8:27 AM