[jboss-user] [jBPM] - Re: getProcess in ProcessInstanceImpl throws a NullPointerException

Marco Rietveld do-not-reply at jboss.com
Fri Apr 5 05:44:10 EDT 2013


Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the discussion

"Re: getProcess in ProcessInstanceImpl throws a NullPointerException"

To view the discussion, visit: https://community.jboss.org/message/806645#806645

--------------------------------------------------------------
Having written what I've written above (about +not fooling around with tx's and the engine+), if you are really, really, really, really, really, really sure that you want to go down that road, you can do the following: 

Start and  end the JTA transaction yourself. 

It's that simple: the core persistence mechanism in Drools/jBPM checks to see if there's an active transaction first before starting one -- and it also keeps track of whether or not it started a transaction. That way, it will  not commit the transaction if it has also not started the transaction. 

However, as Elmer Fudd used to say, +be vewy, vewy+ careful when you're doing this. Open the tx, do your thing with the engine and close the tx immediately: +remember that the process instance state is saved *only* when the transaction commits*.*+ If you do 2 or more actions that modify the process instance, you'll +probably+ be okay. If you modify the processs instance state +and+ "reach into the engine" to do weird things, good luck! 

Some of the other core committers to the jBPM project would disagree with me about this: they might say "Ahh, Marco's being a wimp -- there are no problems with tx's. Go ahead and have a transaction party!". They will be right 99% of the time -- but if you get into complicated (high load/performance) situations with jBPM and user-controlled tx's, I'd wouldn't bet on it.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/806645#806645]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130405/0ebc3950/attachment.html 


More information about the jboss-user mailing list