3 Replies Latest reply on Sep 20, 2005 11:41 AM by tom.baeyens

    who needs transient variables ?

    tom.baeyens

      hi,

      for the next version of jbpm, i'm building a thread local context map. basically it is a convenient way to store information in a ThreadLocal.

      after writing the thread context for other purposes i saw that it could replace the transient variables.

      in fact, can't transient variables always be replaced by making use of a ThreadLocal ?

      what do you think ?

      regards, tom.

        • 1. Re: who needs transient variables ?
          kukeltje

          if the businesslogic is within the same thread yes, but how do you see it if the bl (or code excuted from an asyn action) is not run within the same thread? Is it easy to retrieve the context map from the threadlocal? If so I do not see a problem. It should however not be exposed to the user that a threadlocal solution is used.

          • 2. Re: who needs transient variables ?
            houyunf

            Well, in that case, I think you should not use transient variable. In my understanding, thansient variable will be discarded when entering into state or task node, or what ever node type will keep the process in a non-complete state.


            Yunfeng Hou

            • 3. Re: who needs transient variables ?
              tom.baeyens

              asynchronous continuation of a process will also dispose the transient variables.

              the availability of transient variables and the thread locals will be very similar, i guess. but i decided to keep the transient variables for backwards compatibilty anyway.

              regards, tom.