You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by dm...@eiskonzept.com on 2013/04/19 19:18:58 UTC

Java EE Scheduler implementation in TomEE

Hello,

I have a question in relation to Scheduling API in TomEE. As I know org.apache.openejb.core.timer.DatabaseTimerStore is not implemented yet, and it means that any task created with TimerService and persistent=true will be not persisted over JVM restarts.
Is there any plans or estimations to implement scheduled task persistence in TomEE? 
We have to use plain Quartz scheduler now as workaround. Will be Quartz API supported in future releases of TomEE? How will it be updated? 

Best regards
Dmitry Volkov. 

Re: AW: Java EE Scheduler implementation in TomEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
ok, looked quickly

the easier would be to
implement org.apache.openejb.core.timer.DatabaseTimerStore and to add it as
value to the property timerStore.class in application.properties

do you want to have a try? since it should be able to be provided in the
app you can implement a store more "fun" relying on NoSQL database instead
(would be easier since you can simply serialize the data inside instead of
needing to convert it into sql).

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/4/22 <dm...@eiskonzept.com>

> Here it is: https://github.com/eiskonzept/tomee.git
> There is preinitialized hsqldb database in the project.
>
> To reproduce the issue:
>
> 1. package the project: mvn package
> 2. start tomee plugin with node1 profile: mvn tomee:run -P node1
> 3. open http://localhost:8080/tomee_replication-1.0/schedule.xhtml in
> browser
> 4. push "Schedule timer" button -> timer is scheduled and listed on the
> page. Timer executed every second and logged in console.
> 5. stop tomee instance.
> 6. start tomee instance and check console log. Timer is restored and
> executed
> 7. open http://localhost:8080/tomee_replication-1.0/schedule.xhtml ->
> Timer is not listed. Method TimerService.getTimers() returns empty list.
> There is no possibility to unschedule old timers.
>
>
> -----Ursprüngliche Nachricht-----
> Von: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> Gesendet: Montag, 22. April 2013 10:18
> An: users@tomee.apache.org
> Betreff: Re: AW: Java EE Scheduler implementation in TomEE
>
> can be an embedded test i think with a file database (hsqldb/h2) doing a
> start/stop of an EJBContainer
>
> that said a small war project can be fine too, the main constraint are:
> * buildable on my side easily
> * runnable easily
>
>

AW: AW: Java EE Scheduler implementation in TomEE

Posted by dm...@eiskonzept.com.
Here it is: https://github.com/eiskonzept/tomee.git 
There is preinitialized hsqldb database in the project.

To reproduce the issue: 

1. package the project: mvn package
2. start tomee plugin with node1 profile: mvn tomee:run -P node1
3. open http://localhost:8080/tomee_replication-1.0/schedule.xhtml in browser
4. push "Schedule timer" button -> timer is scheduled and listed on the page. Timer executed every second and logged in console. 
5. stop tomee instance. 
6. start tomee instance and check console log. Timer is restored and executed
7. open http://localhost:8080/tomee_replication-1.0/schedule.xhtml -> Timer is not listed. Method TimerService.getTimers() returns empty list. There is no possibility to unschedule old timers. 


-----Ursprüngliche Nachricht-----
Von: Romain Manni-Bucau [mailto:rmannibucau@gmail.com] 
Gesendet: Montag, 22. April 2013 10:18
An: users@tomee.apache.org
Betreff: Re: AW: Java EE Scheduler implementation in TomEE

can be an embedded test i think with a file database (hsqldb/h2) doing a start/stop of an EJBContainer

that said a small war project can be fine too, the main constraint are:
* buildable on my side easily
* runnable easily


Re: AW: Java EE Scheduler implementation in TomEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
can be an embedded test i think with a file database (hsqldb/h2) doing a
start/stop of an EJBContainer

that said a small war project can be fine too, the main constraint are:
* buildable on my side easily
* runnable easily

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/4/22 <dm...@eiskonzept.com>

> Integration test is needed to reproduce this issue, I think. Would be
> small application enough for reproducing the issue on your side?
>
> -----Ursprüngliche Nachricht-----
> Von: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> Gesendet: Sonntag, 21. April 2013 23:10
> An: users@tomee.apache.org
> Betreff: Re: AW: Java EE Scheduler implementation in TomEE
>
> Strict plan no but if you want to work on it (can be a patch or it can
> start with a unit test showing the issue) we can help/do it Le 21 avr. 2013
> 22:31, <dm...@eiskonzept.com> a écrit :
>
> > Just tested with trunk version and JobStoreCMT. There is one limitation:
> > timers are executed after restart, but method TimerService.getTimers()
> > returns empty list, making it impossible to remove old timers. Are
> > there any plans to fix this limitation?
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> > Gesendet: Sonntag, 21. April 2013 16:31
> > An: users@tomee.apache.org
> > Betreff: Re: Java EE Scheduler implementation in TomEE
> >
> > It should be on trunk. There was some limitations but cant remember
> > which ones.
> >
> > Btw it was traced on jira
> > Le 21 avr. 2013 16:11, <dm...@eiskonzept.com> a écrit :
> >
> > > That would be great. Is this functionality already implemented in
> TomEE?
> > >
> > > Пользователь Romain Manni-Bucau <rm...@gmail.com> писал:
> > >
> > >
> > > Think we can persist stuff through quartz config Le 19 avr. 2013
> > > 19:19, <dm...@eiskonzept.com> a écrit :
> > >
> > > > Hello,
> > > >
> > > > I have a question in relation to Scheduling API in TomEE. As I
> > > > know org.apache.openejb.core.timer.DatabaseTimerStore is not
> > > > implemented yet, and it means that any task created with
> > > > TimerService and persistent=true will be not persisted over JVM
> restarts.
> > > > Is there any plans or estimations to implement scheduled task
> > > > persistence in TomEE?
> > > > We have to use plain Quartz scheduler now as workaround. Will be
> > > > Quartz API supported in future releases of TomEE? How will it be
> > updated?
> > > >
> > > > Best regards
> > > > Dmitry Volkov.
> > > >
> > >
> >
>

AW: AW: Java EE Scheduler implementation in TomEE

Posted by dm...@eiskonzept.com.
Integration test is needed to reproduce this issue, I think. Would be small application enough for reproducing the issue on your side? 

-----Ursprüngliche Nachricht-----
Von: Romain Manni-Bucau [mailto:rmannibucau@gmail.com] 
Gesendet: Sonntag, 21. April 2013 23:10
An: users@tomee.apache.org
Betreff: Re: AW: Java EE Scheduler implementation in TomEE

Strict plan no but if you want to work on it (can be a patch or it can start with a unit test showing the issue) we can help/do it Le 21 avr. 2013 22:31, <dm...@eiskonzept.com> a écrit :

> Just tested with trunk version and JobStoreCMT. There is one limitation:
> timers are executed after restart, but method TimerService.getTimers() 
> returns empty list, making it impossible to remove old timers. Are 
> there any plans to fix this limitation?
>
> -----Ursprüngliche Nachricht-----
> Von: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> Gesendet: Sonntag, 21. April 2013 16:31
> An: users@tomee.apache.org
> Betreff: Re: Java EE Scheduler implementation in TomEE
>
> It should be on trunk. There was some limitations but cant remember 
> which ones.
>
> Btw it was traced on jira
> Le 21 avr. 2013 16:11, <dm...@eiskonzept.com> a écrit :
>
> > That would be great. Is this functionality already implemented in TomEE?
> >
> > Пользователь Romain Manni-Bucau <rm...@gmail.com> писал:
> >
> >
> > Think we can persist stuff through quartz config Le 19 avr. 2013 
> > 19:19, <dm...@eiskonzept.com> a écrit :
> >
> > > Hello,
> > >
> > > I have a question in relation to Scheduling API in TomEE. As I 
> > > know org.apache.openejb.core.timer.DatabaseTimerStore is not 
> > > implemented yet, and it means that any task created with 
> > > TimerService and persistent=true will be not persisted over JVM restarts.
> > > Is there any plans or estimations to implement scheduled task 
> > > persistence in TomEE?
> > > We have to use plain Quartz scheduler now as workaround. Will be 
> > > Quartz API supported in future releases of TomEE? How will it be
> updated?
> > >
> > > Best regards
> > > Dmitry Volkov.
> > >
> >
>

Re: AW: Java EE Scheduler implementation in TomEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Strict plan no but if you want to work on it (can be a patch or it can
start with a unit test showing the issue) we can help/do it
Le 21 avr. 2013 22:31, <dm...@eiskonzept.com> a écrit :

> Just tested with trunk version and JobStoreCMT. There is one limitation:
> timers are executed after restart, but method TimerService.getTimers()
> returns empty list, making it impossible to remove old timers. Are there
> any plans to fix this limitation?
>
> -----Ursprüngliche Nachricht-----
> Von: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> Gesendet: Sonntag, 21. April 2013 16:31
> An: users@tomee.apache.org
> Betreff: Re: Java EE Scheduler implementation in TomEE
>
> It should be on trunk. There was some limitations but cant remember which
> ones.
>
> Btw it was traced on jira
> Le 21 avr. 2013 16:11, <dm...@eiskonzept.com> a écrit :
>
> > That would be great. Is this functionality already implemented in TomEE?
> >
> > Пользователь Romain Manni-Bucau <rm...@gmail.com> писал:
> >
> >
> > Think we can persist stuff through quartz config Le 19 avr. 2013
> > 19:19, <dm...@eiskonzept.com> a écrit :
> >
> > > Hello,
> > >
> > > I have a question in relation to Scheduling API in TomEE. As I know
> > > org.apache.openejb.core.timer.DatabaseTimerStore is not implemented
> > > yet, and it means that any task created with TimerService and
> > > persistent=true will be not persisted over JVM restarts.
> > > Is there any plans or estimations to implement scheduled task
> > > persistence in TomEE?
> > > We have to use plain Quartz scheduler now as workaround. Will be
> > > Quartz API supported in future releases of TomEE? How will it be
> updated?
> > >
> > > Best regards
> > > Dmitry Volkov.
> > >
> >
>

AW: Java EE Scheduler implementation in TomEE

Posted by dm...@eiskonzept.com.
Just tested with trunk version and JobStoreCMT. There is one limitation: timers are executed after restart, but method TimerService.getTimers() returns empty list, making it impossible to remove old timers. Are there any plans to fix this limitation? 

-----Ursprüngliche Nachricht-----
Von: Romain Manni-Bucau [mailto:rmannibucau@gmail.com] 
Gesendet: Sonntag, 21. April 2013 16:31
An: users@tomee.apache.org
Betreff: Re: Java EE Scheduler implementation in TomEE

It should be on trunk. There was some limitations but cant remember which ones.

Btw it was traced on jira
Le 21 avr. 2013 16:11, <dm...@eiskonzept.com> a écrit :

> That would be great. Is this functionality already implemented in TomEE?
>
> Пользователь Romain Manni-Bucau <rm...@gmail.com> писал:
>
>
> Think we can persist stuff through quartz config Le 19 avr. 2013 
> 19:19, <dm...@eiskonzept.com> a écrit :
>
> > Hello,
> >
> > I have a question in relation to Scheduling API in TomEE. As I know 
> > org.apache.openejb.core.timer.DatabaseTimerStore is not implemented 
> > yet, and it means that any task created with TimerService and 
> > persistent=true will be not persisted over JVM restarts.
> > Is there any plans or estimations to implement scheduled task 
> > persistence in TomEE?
> > We have to use plain Quartz scheduler now as workaround. Will be 
> > Quartz API supported in future releases of TomEE? How will it be updated?
> >
> > Best regards
> > Dmitry Volkov.
> >
>

Re: Java EE Scheduler implementation in TomEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
It should be on trunk. There was some limitations but cant remember which
ones.

Btw it was traced on jira
Le 21 avr. 2013 16:11, <dm...@eiskonzept.com> a écrit :

> That would be great. Is this functionality already implemented in TomEE?
>
> Пользователь Romain Manni-Bucau <rm...@gmail.com> писал:
>
>
> Think we can persist stuff through quartz config
> Le 19 avr. 2013 19:19, <dm...@eiskonzept.com> a écrit :
>
> > Hello,
> >
> > I have a question in relation to Scheduling API in TomEE. As I know
> > org.apache.openejb.core.timer.DatabaseTimerStore is not implemented yet,
> > and it means that any task created with TimerService and persistent=true
> > will be not persisted over JVM restarts.
> > Is there any plans or estimations to implement scheduled task persistence
> > in TomEE?
> > We have to use plain Quartz scheduler now as workaround. Will be Quartz
> > API supported in future releases of TomEE? How will it be updated?
> >
> > Best regards
> > Dmitry Volkov.
> >
>

Re: Java EE Scheduler implementation in TomEE

Posted by dm...@eiskonzept.com.
That would be great. Is this functionality already implemented in TomEE?

Пользователь Romain Manni-Bucau <rm...@gmail.com> писал:


Think we can persist stuff through quartz config
Le 19 avr. 2013 19:19, <dm...@eiskonzept.com> a écrit :

> Hello,
>
> I have a question in relation to Scheduling API in TomEE. As I know
> org.apache.openejb.core.timer.DatabaseTimerStore is not implemented yet,
> and it means that any task created with TimerService and persistent=true
> will be not persisted over JVM restarts.
> Is there any plans or estimations to implement scheduled task persistence
> in TomEE?
> We have to use plain Quartz scheduler now as workaround. Will be Quartz
> API supported in future releases of TomEE? How will it be updated?
>
> Best regards
> Dmitry Volkov.
>

Re: Java EE Scheduler implementation in TomEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Think we can persist stuff through quartz config
Le 19 avr. 2013 19:19, <dm...@eiskonzept.com> a écrit :

> Hello,
>
> I have a question in relation to Scheduling API in TomEE. As I know
> org.apache.openejb.core.timer.DatabaseTimerStore is not implemented yet,
> and it means that any task created with TimerService and persistent=true
> will be not persisted over JVM restarts.
> Is there any plans or estimations to implement scheduled task persistence
> in TomEE?
> We have to use plain Quartz scheduler now as workaround. Will be Quartz
> API supported in future releases of TomEE? How will it be updated?
>
> Best regards
> Dmitry Volkov.
>