[jboss-dev-forums] [Design of JBoss jBPM] - Re: Failure handling
bill.burke@jboss.com
do-not-reply at jboss.com
Fri Aug 3 09:30:04 EDT 2007
Ed, with the disclaimer that I've never written a jBPM application, doesn't it really depends who is driving the process. If user code is managing both the transaction and signaling the process, then you can handle this quite easily:
| userTransaction.begin();
| boolean rollback = false;
| try {
| process.signal();
| if (userTransaction.getStatus() == ROLLBACK CONDITION) {
| rollback =true; ut.rollback();
| else ut.commit();
| } catch (Exception ex) { rollback = true; userTransaction.rollback()}
|
| if (rollback) {
| ut.begin(); process.signal("failure");
| }
|
If the process is being driven by an asynchronous continuation or a user MDB, then you can use the DLQ or Transaction Synchronization ideas stated. I'm writing a blog about this very case. I'll link when I'm done.
As far as DLQ goes. Most(all?) major JMS providers have DLQ support. As for Transaction Synchronizations? You'd need access to TM yes. But there are well documented ways of obtaining the TM on each major application server. You just have to look. If you're in EE5, there is a TransactionSynchroniationRegistry that all vendors must provide.
Answer your questions?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070594#4070594
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070594
More information about the jboss-dev-forums
mailing list