3 Replies Latest reply on May 6, 2007 4:29 PM by Ronald van Kuijk

    JbpmContext.getProcess() vs. loadProcess()

    s b Newbie

      Can someone explain the difference between JbpmContext.getProcessInstance(..) and JbpmContext.loadProcessInstance(..)?

      Thanks

        • 1. Re: JbpmContext.getProcess() vs. loadProcess()
          Ronald van Kuijk Master

          if you follow the sourcecode (it's free) you see that the difference is that one method does a session.load and the other does a session.get. If you look furter, you'll see that session is a org.hibernate.Session, so the difference is in the behaviour of that. If you then use google (it is your friend you know) with a 'hibernate session load get' query, you'll get something back like
          http://lijinjoseji.wordpress.com/2007/01/20/hibernate-difference-between-sessions-get-and-load/

          Next time I assume you can do this very easily yourself (it cost me less than 15 minutes and with a minimal of 1 hour at a rate of ?100,- per hour, that is what I would charge you in real life, and NO I'M NOT KIDDING)

          • 2. Re: JbpmContext.getProcess() vs. loadProcess()
            s b Newbie

             

            "kukeltje" wrote:
            if you follow the sourcecode (it's free) you see that the difference is that one method does a session.load and the other does a session.get. If you look furter, you'll see that session is a org.hibernate.Session, so the difference is in the behaviour of that. If you then use google (it is your friend you know) with a 'hibernate session load get' query, you'll get something back like
            http://lijinjoseji.wordpress.com/2007/01/20/hibernate-difference-between-sessions-get-and-load/

            Next time I assume you can do this very easily yourself (it cost me less than 15 minutes and with a minimal of 1 hour at a rate of ?100,- per hour, that is what I would charge you in real life, and NO I'M NOT KIDDING)


            Thanks, I didn't really want you to search for me, just if anyone knew and if it were an important issue. I think it is, but there are still some subtleties you have to be careful of when using "load" that would be worth discussion. I did trace the code to session.load(), but I was under the impression that hibernate might not be the only persistence implementation available or planned and that therefore the semantic difference between "get" and "load" should be documented (and enforced) at the JbpmContext level where it is exposed.

            • 3. Re: JbpmContext.getProcess() vs. loadProcess()
              Ronald van Kuijk Master

              I do not disagree with this, but then it is better to fomulate the question differently next time. It is (next to) impossible for me to have the same context as you have, so therefore my kind of aggravated answer.