Transaction TimeOut
1 posts in topic
Flat View  Flat View

Posted By:   vijaya_lakshmi
Posted On:   Wednesday, April 18, 2001 05:39 AM

1) An application an session bean, where a session bean is running infinitly util it is forced to stop.

2) Session bean inturn calling an entity bean to retrieve data by a finder methids within a while loop for every now and then based on the retrieve frequency provided.

3) The problem is, it is working fine upto 300 seconds and throwing exception when it tries to access the data after 300 seconds. (throwing time out error and rolled back after 300 seconds)

please give a solution for this.

Re: Transaction TimeOut

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:
  1. deploy the bean TX_BEAN_MANAGED

  2. do a context lookup to get the javax.transaction.UserTransaction object

  3. before doing the transaction, call userTransaction.setTransactionTimeout(yourValue)

  4. call userTransaction.begin(), do whatever you are going to do, then call userTransaction.commit(), being careful to check for a failure to commit

About | Sitemap | Contact