If your function is inside an EJB3 you can annotate it:
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.
thank you for your reply, i will try your solution
and will report the result later...
sorry for my late answer.
for me your solution worked perfectly!
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...
This is what
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.
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?
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.
No flush mode is set anywhere in my code or in my .xml files so I guess it's the default flush mode.
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.
This is probably the case, because adding
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.