In a Websphere7 environment, the container is set to timeout any transaction that last longer than 120 seconds for all of our CMT Session Beans.
However, I've been ask to add a feature in one of our EJB, and the time to proceed it will be larger than this timeout (around 20 minutes). As this is a one-shot feature, I really don't want to increase the transaction timeout, as it will impact all other beans.
Is it possible to declare that one method in a bean, or a specific session bean, has it's own timeout delay ?
开发者_开发问答If that's not possible, I suppose my only solution is to create a CMT bean ?
Thanks !
I don't know websphere7, for Jboss you have something like this and maybe you will find something similar for websphere7. If not, in my opinion, you have 3 options.
- Re-architecture your solution to use MDB's for long running tasks to execute them asynchronously
- User UserTransaction and setTransactionTimeout to set the transaction timeout for the specific transaction
- Create a separate CMT bean with exclusive transaction timeout specified in xml for this functionality
精彩评论