1 Reply Latest reply: Apr 16, 2012 12:05 PM by Cory Dahlstrom RSS

Seam 2.2.2, jBoss AS 7 TransactionTimeout

nt2005 Newbie

Hello Community,

 

I have an web application which do a long transaction (because of running jbpm 5 process).

The transactiontimeout of 300 secounds is to short. I can increase the timeout globaly in the config of the server (standalone.xml) but I want it only in my bean or methode.

 

What I try:

@Stateful
@Name(TestBeanImpl.NAME)
@JndiName(value=TestBeanImpl.JNDI_NAME)
@Scope(ScopeType.SESSION)
@TransactionTimeout(value=30000)
public class TestBean implements TestBeanImpl {

    @In
    private EntityManager entityManager;
    
    @TransactionTimeout(value=30000)
    @Override
    public void start() {
        // heavy jbpm process
    }
    
    @Remove
    @Destroy
    @Override
    public void remove() {
        
    }
}

 

But the transactiontimeout does not change in any way... anyone have an idea?

  • 1. Re: Seam 2.2.2, jBoss AS 7 TransactionTimeout
    Cory Dahlstrom Novice

    We had this same issue a few years back on an older version of JBoss.  I assume you have <transaction:ejb-transaction/> specified in your components.xml file?

     

    First off, the reason  this is happening is the transaction has already been started by the time start() method has been called on your bean.  Because of this, you can't change the timeout.

     

    You can do 1 of 2 things:

     

    1) Get rid of <transaction:ejb-transaction/> in components.xml and control the transactions yourself by delegating to a SLSB and starting the transaction with the specfied timeout.

     

    2) If you can't do #1 ( we couldn't do #1 ), I have another solution which I can send you.

     

    Cory.