-
1. Re: JTA transaction timeout
gjeudy Sep 26, 2008 4:49 PM (in response to wachtda.scsi.gmx.ch)If your function is inside an EJB3 you can annotate it:
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) @TransactionTimeout(600)
Although others report that @TransactionTimeout doesn't work its probably worth trying as it is part of the suggested solution.
Let us know how it goes.
-
2. Re: JTA transaction timeout
wachtda.scsi.gmx.ch Sep 26, 2008 6:23 PM (in response to wachtda.scsi.gmx.ch)thank you for your reply, i will try your solution
and will report the result later... -
3. Re: JTA transaction timeout
wachtda.scsi.gmx.ch Oct 6, 2008 8:51 AM (in response to wachtda.scsi.gmx.ch)hello guillaume
sorry for my late answer.
for me your solution worked perfectly!@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) @TransactionTimeout(600)
it would be much butter if my action would create a new transaction on each method call but i think this is nod possible with seam managed transactions...
-
4. Re: JTA transaction timeout
gjeudy Oct 6, 2008 3:33 PM (in response to wachtda.scsi.gmx.ch)hi daniel,
This is what
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
does. When the EJB container sees it on a business method call it suspends any caller transaction to start a new one.For @TransactionTimeout to work you have to start a new transaction. In other words @TransactionTimeout is ignored if your method joins an already running transaction.
-
5. Re: JTA transaction timeout
toni Nov 19, 2008 5:15 PM (in response to wachtda.scsi.gmx.ch)Hi,
I'm using
@TransactionTimeout(9000000)
on the method of a SFSB because the database update takes longer than the default of 300 seconds.
However, the annonation does not increase the transaction timeout, if used alone. The transaction always times out after 5 minutes, no matter what value. I had to increase the global transaction timeout. Only raising it helps.
I tried from this thread to combine @TransactionTimeout with @TransactionAttribute(TransactionAttributeType.REQUIRESNEW) which helps. The timeout all of a sudden changes. So using @TransactionAttribute(TransactionAttributeType.REQUIRESNEW) in combination with @TransactionTimeout works, but only PARTLY.
The problem is that after the method completes NONE of the changes are persisted and no error is thrown. This is really weird. I have noticed this issue before unfortunantely nobody really seems to care about this.
Has anybody some solid explanation for this?
-
6. Re: JTA transaction timeout
gjeudy Nov 19, 2008 6:11 PM (in response to wachtda.scsi.gmx.ch)what is the flush mode set on your persistence context? If its set to manual then unless you explicitely flush the context it will never execute SQL statements in the database.
-
7. Re: JTA transaction timeout
toni Nov 19, 2008 7:21 PM (in response to wachtda.scsi.gmx.ch)No flush mode is set anywhere in my code or in my .xml files so I guess it's the default flush mode.
-
8. Re: JTA transaction timeout
steffi.stephanie.stroka.salzburgresearch.at Nov 20, 2008 9:35 AM (in response to wachtda.scsi.gmx.ch)Maybe you are using @Transactional on a method that is wrapped around by another Transaction. If this is true, the Transaction Timeout of the outer Transaction is used.
-
9. Re: JTA transaction timeout
toni Nov 20, 2008 11:03 AM (in response to wachtda.scsi.gmx.ch)This is probably the case, because adding
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
to the method changes the timeout to the desired value. Unfortunately none of the actions are persisted.
On the other hand I'm wondering why there should be another transaction. The SFSB is dealing with the clients. The method that is called deletes a client and is referenced in the jsp via an normal action. It takes about 7 minutes to complete. In the method nothing else is referenced or used but entity beans.