-
1. Re: @Schedule delay before initial firing....
nickarls Dec 20, 2012 2:42 AM (in response to tony.herstell1)I don't think(tm) it can be done with Schedule. TimerService has some functionality for it but you could always timestamp in @PostConstruct and exit early if enough delay has not been reached...
-
2. Re: @Schedule delay before initial firing....
sfcoy Dec 20, 2012 2:54 AM (in response to tony.herstell1)You could also try injecting an EntityManager into the EJB with the @Schedule annotation. This may delay it's deployment until Hibernate is fully initialised.
-
3. Re: @Schedule delay before initial firing....
jaikiran Dec 20, 2012 4:49 AM (in response to tony.herstell1)Or you can keep it more within your code and in the @Schedule method, look for some field in the DB or some other place which tells you whether or not the DB import is done. If it isn't then just return from that @Schedule method and since it fires every few minutes, you don't have to worry about rescheduling it.
-
4. Re: @Schedule delay before initial firing....
tony.herstell1 Dec 20, 2012 2:14 PM (in response to jaikiran)All great solutions.
Thanks... I guess I should have "thought" before I asked.
Sadly common sense is not common.
> don't think(tm) it can be done with Schedule. TimerService has some functionality for it but you could always timestamp in @PostConstruct and exit early if enough delay has not been reached...
Nice solution
> You could also try injecting an EntityManager into the EJB with the @Schedule annotation. This may delay it's deployment until Hibernate is fully initialised.
I am wary of this as the framework writers go and change stuff like that...
> look for some field in the DB
Nice solution too
I used this pattern for "batching".
I suppose I also asked beacuse it sort of a nice feature request as I needed it and it wasn't there.