1 Reply Latest reply on May 17, 2006 5:26 AM by Tom Baeyens

    caching GraphSession object

    Greg McGregor Newbie

      In an webapp environment, after obtaining the GraphSession object,

      GraphSession graphSession = jbpmContext.getGraphSession();

      The above method takes a while, so can I cache it as a session object?

        • 1. Re: caching GraphSession object
          Tom Baeyens Master

          it's not the graph session take takes time to create.

          it's probably the hibernate session factory that is created the first time around. the hibernate session is cached somewhere in the JbpmConfiguration. so you should not worry about that.

          you should keep the JbpmConfiguration in a static field or in the webapp's application scope attributes somewhere.

          the object is already cached in its lifespan: the jbpmContext.

          whenever you get it a second time inside of the same jbpmContext, you'll get the same object from the cache.