-
1. Re: Singleton Bean Transaction Management
jaikiran Aug 6, 2012 3:41 AM (in response to method_ben_qc)What does the import statement for @TransactionTimeout look like?
-
2. Re: Singleton Bean Transaction Management
method_ben_qc Aug 6, 2012 9:21 AM (in response to jaikiran)import org.jboss.ejb3.annotation.TransactionTimeout;
-
3. Re: Singleton Bean Transaction Management
papangdim Aug 9, 2012 5:40 AM (in response to method_ben_qc)Hi,
I face the same problem but what I think I noticed was that if I had set my timeout to something less than 5 minutes, (say 30 seconds) the timeout was honoured and the transaction reaper kicked in exactly 30 sec after the transaction had started. So I then changed the timeout back to 30 minutes hoping that this would work but it seems that the transaction reaper kicked in after 5 minutes as defined in the xml file.
Thank you
-
4. Re: Singleton Bean Transaction Management
erhard Aug 13, 2013 3:44 AM (in response to papangdim)Hi,
Is this intended behaviour? The default-timeout from the standalone.xml can be shortend with the annotation, but not increased?
I have a similar problem with a long PostConstruct-method in a singleton using EAP6.0.1
Erhard
-
5. Re: Singleton Bean Transaction Management
sfcoy Aug 13, 2013 5:46 AM (in response to erhard)Do your initialisation operations really need to be transactional?
Are they performing database operations or sending JMS messages?
-
6. Re: Singleton Bean Transaction Management
erhard Aug 13, 2013 6:13 AM (in response to sfcoy)In this particular case, I could do without transactions. We just call one existing EJB and the first call to any of our EJBs takes a long time for reasons I could explain in private if anybody is interested. All our EJBs are just @Stateless and therefore they open transactions.
This might or might not be clever, but I think it is not the isssue. I find it confusing that the annotation does not work as I expected and that apearently one can decrease the timeout, but not increase it. I didn't try it but mybe its not even related to Singletons, since its just the CMTTxInterceptor that handles the Transaction? Therefore my question is wether this is intended or a bug.
-
7. Re: Singleton Bean Transaction Management
sfcoy Aug 13, 2013 6:29 AM (in response to erhard)I can't remark on the behaviour of the annotation.
However, long running transactions can cause all kinds of issues and you should design around avoiding them if possible.
If you're processing an import file for example, consider processing it (say) fifty rows at a time and execute multiple short transactions instead.