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

2008-12-11 Thread bolbit
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
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


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

2009-05-27 Thread bolbit
Hey mclu,

sorry, but I have no solution. I raised the Transaction Timeout for the EJB 
Method sending the messages and 
accept that sometimes the method will be aborted because of a timeout. In order 
to avoid the rollback of the successfuly sended messages I use an EJB Method to 
send one single message with the transaction attribute "requieresNew". This 
Method is called from the method wich sends all messages.

So the abort of the outer method will have no effect on the messges already 
sent.

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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4233782
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user