Search code examples
javajbossejbejb-3.1

EJB @Schedule timing out method call


I am using an EJB @Schedule

@Schedule(hour:"18")
someProcess(){

//this code takes 10 minutes
}

This is failing because my cod takes > 3 minutes which is the default time in my Jboss. Is there anyway I can handle this programmatically ? I do not want to change the standalone.xml becuase that will have a bigger impact. Is there anyway I can tell JBOSS/JVM to run this as long as it takes and not time out.


Solution

  • Change your code to:

    @TransactionAttribute(NOT_SUPPORTED)
    @Schedule(hour:"18")
    void someProcess(){
    
          //this code takes 10 minutes
    
    }
    

    in order to prevent transaction timeout from occurring.