2

I have a method, annotated as such :

@Schedule(hour = "*", minute = "*", second = "*/1")
public void sampleData () {... Process can be long or short ... }

Inside a @Singleton EJB. The method is therefore executed by Glassfish every second.

Question :

What happens if the method takes more than 1 second to complete ?

  1. Is the invocation cancelled and another method invoked ?
  2. Are the calls to the method queued ?
  3. Are calls to this method halted whilst the method is still in execution ?
  4. Is the same method executed twice concurrently ? (not possible in @Singleton ??)

Would the @Asynchronous annotation modify the default behaviour ?

I want the method to execute every second and no calls made to the @Schedule method until all other instances have completed. How should I configure my class ?

klonq
  • 3,535
  • 4
  • 36
  • 58
  • You may find some relevant information here : http://stackoverflow.com/questions/14402068/ejb-schedule-wait-until-method-completed – Arnaud Jul 13 '16 at 12:27

0 Answers0