Well, the 'proper' way to do things would be to only use transacted resources 
in your nodes. If the resources don't support transactions (e.g. smtp) you 
would have to 'wrap' them in ones that do, e.g. send a JMS Message that would 
only get sent if the whole transaction gets commited.

That way if your JVM crashes you're back to where you started, no harm done.

Setting everything to auto-commit won't help you. Just image your JVM crashes 
the ms after you have executed something but have not yet saved the new state. 
You still don't have 100% data integrity, you're only "a litte bit" better off, 
which effectively means its just as bad as before.

If I remember correctly hibernate will turn off any auto-commit setting, for 
good reason.

If you want to implement 'checkpoints' and break the transaction up into 
smaller bits, put in wait states. That stops the workflow and gives jBPM a 
chance to save state. If you want a continuous workflow with 'checkpoints' 
build a asynch mech with JMS that signals() the Token you just sent to sleep. 
(or wait for the asynch feature in jBPM).

If you realy want to fine tune your transactions call Token.signal() from 
behind a SLSB with bean managed transactions, get a UserTransaction, save that 
as a transient variable or ThreadLocal and go... its all yours then.

The concurrency issue isn't all that hard to solve. Either lock on the 
ProcessInstance or if that is to global for you (as it is for me) wait until 
I've found and posted the answer to my question  
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=73332. Sometime during 
the coming week. (The jBPM Team didn't even read the post :-( )

This probably isn't what you wanted to here, but there are no easy ways with 
data consistency and concurrency.

Have a nice wekend.

Rainer

P.S.: All this only applies in a managed environment.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3910343#3910343

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3910343


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to