-
1. Re: Local human task service doesn't participate in a JTA transaction
salaboy21 Mar 9, 2013 6:11 PM (in response to devinderpal)Can you explain what is this:
com.mycompany.db.MyCompanyTransactionManager ???
-
2. Re: Local human task service doesn't participate in a JTA transaction
devinderpal Mar 9, 2013 8:00 PM (in response to salaboy21)Mauricio,
Thanks for your reply.
I have attached MyCompanyTransactionManager. Please note than I'm not allowed to share the original code, so classname and package are changed. But contents are accurate.
-
3. Re: Local human task service doesn't participate in a JTA transaction
devinderpal Mar 9, 2013 8:02 PM (in response to devinderpal)sorry, here is the file
-
MyCompanyTransactionManager.java.zip 550 bytes
-
-
4. Re: Local human task service doesn't participate in a JTA transaction
salaboy21 Mar 12, 2013 10:02 AM (in response to devinderpal)I will not review that, because that's not part of the jbpm codebase, if you decided to add your own TransactionManager, you need to make sure that it works correctly and that its not causing issues with the frameworks that use it.
Cheers
-
5. Re: Local human task service doesn't participate in a JTA transaction
devinderpal Mar 12, 2013 1:14 PM (in response to salaboy21)Mauricio,
I'm not using my own TransactionManager. It's a transaction manager lookup class. May be name of the file is not best.
It's a small lookup class that just returns transaction manager bound in "java:jboss/TransactionManager"
By defaut jBPM looks in java:/TransactionManager. That's why this lookup class was added. Below is the code of this class
public class MyCompanyTransactionManager implements TransactionManagerLookup {
public Object getTransactionIdentifier(Transaction transaction){
return transaction;
}
public TransactionManager getTransactionManager(Properties props)
throws HibernateException{
try
{
return (TransactionManager) new InitialContext()
.lookup("java:jboss/TransactionManager");
}
catch (NamingException e)
{
throw new RuntimeException(e);
}
}
public String getUserTransactionName(){
return null;
}
public static TransactionManager getTransactionManager(){
return new MyCompanyTransactionManager().getTransactionManager(null);
}
}
Thanks!
-
6. Re: Local human task service doesn't participate in a JTA transaction
salaboy21 Mar 13, 2013 5:19 PM (in response to devinderpal)Did you try with using just one Persistence Unit?
-
7. Re: Local human task service doesn't participate in a JTA transaction
calca Mar 13, 2013 5:47 PM (in response to devinderpal)Hey, I suggest you try 5.3 or 5.4 and see how it goes..
5.2 local persistence was a bit different:
https://github.com/droolsjbpm/jbpm/blob/d75849efdb4b149e7169237a5282e7882e701f85/jbpm-human-task/src/main/java/org/jbpm/task/service/TaskServiceSession.java You can see it getting the UserTransaction java:comp/UserTransaction, instead from 5.3 you can see there is a Task TransactionManager:
If you make some simple unit test in 5.3 or 5.4 I can take a look.
Thanks
Demian
-
8. Re: Local human task service doesn't participate in a JTA transaction
devinderpal Mar 15, 2013 2:26 PM (in response to calca)1 of 1 people found this helpfulThanks for your responses.
Without making any changes, I was trying to understand this behavior. And I noticed that rollback only fails when I use debugger and try to see the execution by putting breakpoints and going line by line. If no breakpoints are used, rollback work correctly. First time I saw this problem, I was also using debugger.
But I still don't understand why this behavior when using debugger. I guess some kind of timeout is happening due to which rollback doesn't work. If this is a timeout issue, it has to be very small timeout. maybe couple of seconds. Because even when debugging I'm not waiting minutes but going line by line quickly.. may be just delay of 4-5 secs. Without understanding the issue, I'm not sure if it can happen in production too.
Please let me know if you can put some light on it.
-
9. Re: Local human task service doesn't participate in a JTA transaction
salaboy21 Mar 15, 2013 2:38 PM (in response to devinderpal)1 of 1 people found this helpfulGood to know that you find the issue. and as far as I remember the default transaction time out is 5 seconds. Which IMO is ok. The Bitronix documentation mention 60 seconds here: http://docs.codehaus.org/display/BTM/Configuration, but I guess that the underlying DB is closing the connection after 5 seconds.
Can you share the stack trace? if everything goes ok inside the method invocation, it shoudn't take more than 5 secs at least not for the jBPM side.
Cheers
-
10. Re: Local human task service doesn't participate in a JTA transaction
devinderpal Mar 15, 2013 3:21 PM (in response to salaboy21)Mauricio,
jBPM is not taking more than 5 secs. When using debugger, I was stopping the execution by putting breakpoint. So that's why it was timing out.
I'm good for now. Hopefully everything will work in production
Thanks for your time.