0 Replies Latest reply on Nov 16, 2005 10:51 PM by Brad Clements

    jbpm.cfg.xml property, pessimistic locking, race cond in Jbp

    Brad Clements Newbie

      Hi, I'm the guy trying to use Jython w/ Jbpm. So, it's been a tough week trying to figure out why you Java guys make life so complex.

      Tonight, finally, I can get a JbpmSessionFactory!

      Anyway I am leaning towards running in embedded mode, with my own REST based "web service" engine. I might have multiple 'engines' running, so want to ask about 'pessimistic locking' mentioned in this forum when operating in this mode. I assume that pessimistic locking applies either to the jdbc connection (using hsqldb) or to hibernate. But I can't find mentioning of locking in either of those projects docs.

      Where and how should I set this locking?


      One of my big struggles was figuring out how to tell JbpmConfiguration.java where my jbpm.cfg.xml file is. In looking at the code, I had thought that I could do this:

      java -Djbpm.cfg.xml=/path/to/file -cp $CLASSPATH

      But it seems that what I have to do is use the System property to specify just the name of the jbpm.cfg.xml file (like 'my file') and then ALSO make sure that the so-named file exists in the classpath somewhere.

      So, there's no way to explicity specify configuration information without specifying it in a file in the classpath.. Is this normal java technique? Just curious.

      Finally, in looking at JbpmConfiguration.java, I am wondering if this is a possible race condition:

       private static Properties getProperties() {
       if (properties==null) {
       return initProperties();
       return properties;
       private static synchronized Properties initProperties() {

      shouldn't getProperties() also be synchronized? Otherwise two calls to getProperties could both end up blocking in the call to initProperties, such that the properties member would get initialized twice.