This content has been marked as final.
Show 3 replies
-
1. Re: how to turn on ejb transaction demarcation?
mcandelo Mar 4, 2009 6:25 PM (in response to kannattaa)I know little (nothing) about seam, but with stateless beans I've had very little success annotating private methods with @TransactionAttribute. I believe those annotations only work when the method is called from outside the EJB. In this case, it's probably just best for you to inject the UserTransaction as a @Resource and work with that. You should be able to use begin(), commit(), & rollback() for all your transaction needs.
-
2. Re: how to turn on ejb transaction demarcation?
kannattaa Mar 5, 2009 7:34 AM (in response to kannattaa)thank you!
i've tried @TransactionAttribute outside the bean and it's helped. -
3. Re: how to turn on ejb transaction demarcation?
mcandelo Mar 5, 2009 9:53 AM (in response to kannattaa)One other thing I forgot was the @TransactionManagement and @TransactionAttribute, when injecting the UserTransaction for the thread, I set these items on the bean like so:
@TransactionManagement(TransactionManagementType.BEAN) @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public class MyBean { ...
But this is for bean managed transactions, if you want to continue to use the container managed transactions which is the default, you don't need these, but you can specifically request CMT by doing this:@TransactionManagement(TransactionManagementType.CONTAINER) public class MyBean { ...