[jboss-user] [EJB/JBoss] - set TransactionTimeout during Runtime

bolbit do-not-reply at jboss.com
Thu Dec 11 05:17:44 EST 2008


Hello,

i have a Session Bean with CMT. In this bean, there is a method which reads out a database generates messages an sends them to a webservice.

Sometimes there are many messages to send, so that the execution of the methode exceeds the timeout so that the transaction is aborted by the transaction manager.

my vision is that i determine the number of messages and multiply it with x seconds (avarage sending time for 1 message) and have my transaction timeout.

But How can i set the timeout dynamically during runtime?
I found the following wiki-entry:
http://www.jboss.org/community/docs/DOC-12439

This document describes how to set the timeout via the UserTransaction BUT only for Transactions started AFTER the setting of the new timeout.

How can i do this with my CMT Bean?
When i commit the UserTransaction and start a new one within the method i recieve an exception
java.lang.IllegalStateException: Wrong transaction association

Can anyone help me with this problem?

Thanks in advance

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4195865#4195865

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4195865



More information about the jboss-user mailing list