开发者

EJB CMT and transaction timeout

开发者 https://www.devze.com 2023-04-04 10:06 出处:网络
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.

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.

  1. Re-architecture your solution to use MDB's for long running tasks to execute them asynchronously
  2. User UserTransaction and setTransactionTimeout to set the transaction timeout for the specific transaction
  3. Create a separate CMT bean with exclusive transaction timeout specified in xml for this functionality
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号