Using timeouts with transactions
There are situations where the time used to execute a transaction takes too long. This can result in unresponsive applications or the appearance that the application has locked up. To control this behavioral aspect of transaction we need to limit the amount of time allocated to a transaction. In this recipe, we will address how this is done.
Using timeouts involves:
- Determining whether a timeout period is needed
- Determining what that period should be
- Using the
setTransactionTimeoutmethod in the case of BMT
Determining whether timeouts should occur or what the timeout period should be is application-specific. As a result we will not address the first two steps here.
If it is a CMT, we can use the container ...