Posted By:
Michael_Wax
Posted On:
Wednesday, April 18, 2001 03:43 PM
I'm not sure how to set the transaction timout for containter-managed transactions, but there should be a way to do it. Alternatively, you can use bean-managed transactions, and handle the timeout in the following way:
- deploy the bean TX_BEAN_MANAGED
- do a context lookup to get the javax.transaction.UserTransaction object
- before doing the transaction, call userTransaction.setTransactionTimeout(yourValue)
- call userTransaction.begin(), do whatever you are going to do, then call userTransaction.commit(), being careful to check for a failure to commit