-
1. Re: Altering the transaction timeout
jameswoodward Feb 16, 2007 6:00 AM (in response to pmuir)Yes, in your session bean, you need to annotate your long running method as follows:
@org.jboss.annotation.ejb.TransactionTimeout(3000)
public void doSomethingThatTakesAges() {
...
}
James -
2. Re: Altering the transaction timeout
pmuir Feb 24, 2007 7:23 AM (in response to pmuir)Thanks for the reply James and sorry for the delay in replying - my forum subscriptions went wrong for a bit ;)
I'll try this out on Monday. -
3. Re: Altering the transaction timeout
toni May 3, 2007 4:49 PM (in response to pmuir)I have tried this on my session bean, but I still run into a TransactionTimeout exception. I used the following my stateful session bean:
@org.jboss.annotation.ejb.TransactionTimeout(10000000)
Changing the timeout in jta-service.xml on the other hand works. I'm using seam 1.1 - could it be that this is only supported in higher versions of seam? -
4. Re: Altering the transaction timeout
wolfc May 4, 2007 4:52 AM (in response to pmuir)Transaction timeout only works on the method where the transaction is actually started. Either make sure you put the annotation there or add transaction attribute REQUIRES_NEW on your method.
-
5. Re: Altering the transaction timeout
hbarca Jun 7, 2007 10:06 AM (in response to pmuir)Toni, did the annotation work for you?
It doesn't work for me...
I'm using JBoss 4.0.4, can be this a reason why TransactionTimeout does not work on EJB bussines methods? -
6. Re: Altering the transaction timeout
toni Jun 8, 2007 4:26 AM (in response to pmuir)Hi hbaraca,
if I place the @TransactionTiemout annotation on one of my action methods of my SFSB's, which get called, when user clicks on an action link, then the timeout is being ignored. So it does not work for me. -
7. Re: Altering the transaction timeout
hbarca Jun 11, 2007 8:07 AM (in response to pmuir)Hi Toni,
Oh, my mistake, I put the annotation in the wrong place (at one level deeper in the call chain). Now it works to me, with a SLSB. You have to make sure you put the annotation in the bean implementation code, at the method starting the transaction. By default, a transaction starts when the first call to a session bean method is beeing made from the user code, if no other transaction annotations have been used.
Hope it will work for you too.
Horia -
8. Re: Altering the transaction timeout
rlj Jun 12, 2007 11:18 AM (in response to pmuir)Hi There
I'm so glad to hear someone got this working.
Can anyone of you please see my thread here:
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050135#4050135
.. and tell my what I'm doing wrong.
I'm using Struts and I'm not calling any other methods on that specific bean or any other bean (in the current request that is). So my call-chain is only one step deep.
As you can se at the code-example in my thread I've also tried to set the TransactionAttribute REQUIRES_NEW
The Bean-method get called from my StrutsActionServlet.
Regards
/RLJ