[ 
https://issues.apache.org/jira/browse/TOMEE-3801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tony Weston updated TOMEE-3801:
-------------------------------
    Description: 
Hot deploy, with changes to scheduled methods with @schedule, or 
programatically using Timer and @timeout ,  does not update previously deployed 
scheduled config.

This is reproducible by using this class:

*package* bug;

 

{{*import* java.util.Date;}}{{ }}
 {{*import* javax.ejb.Schedule;}}
 {{*import* javax.ejb.Singleton;}}{{ }}
 {{@Singleton }}
 {{*public* *class* TestSchedular {}}{{ }}
 {{    @Schedule(second = "*/2", minute="*", hour="*" )}}
 {{    *public* *void* doIt() {}}
 {{       System.*_out_*.println("Fired at "+*new* Date());}}
         }
 {{}}}

Deploy to tomee.  Then update the class with a new timing,  say 4 seconds.  
compile, and deploy the new war to Tomee.    Tomee will continue to use the the 
previous 2 second timing after hot-deploy.

Attached file is a video of this happening in Eclipse, as its very easy to 
demonstrate, though this bug is absolutely present in a stand alone TomEE 
server.   The video starts with the schedule set to 2 seconds. After changing 
to 4 seconds, and tomee restarting, the scheduled method continues to fire 
every 2 seconds.

A work around for this bug is to restart TomEE from scratch after each 
deployment.  Set bug level to critical since this makes hot deploy very risky 
if it is not picking up every change in the deployment. 

  was:
Hot deploy, with changes to scheduled methods with @schedule, or 
programatically using Timer and @timeout ,  does not update previously deployed 
scheduled config.

This is reproducible by using this class:

*package* bug;

 

{{*import* java.util.Date;}}{{ }}
{{*import* javax.ejb.Schedule;}}
{{*import* javax.ejb.Singleton;}}{{ }}
{{@Singleton }}
{{*public* *class* TestSchedular {}}{{ }}
{{    @Schedule(second = "*/2", minute="*", hour="*" )}}
{{    *public* *void* doIt() {}}
{{       System.*_out_*.println("Fired at "+*new* Date());}}
{{    }}}
{{}}}

Deploy to tomee.  Then update the class with a new timing,  say 4 seconds.  
compile, and deploy the new war to Tomee.    Tomee will continue to use the the 
previous 2 second timing after hot-deploy.

Attached file is a video of this happening in Eclipse, as its very easy to 
demonstrate, though this bug is absolutely present in a stand alone TomEE 
server.   The video starts with the schedule set to 2 seconds. After changing 
to 4 seconds, and tomee restarting, the scheduled method continues to fire 
every 2 seconds.

A work around for this bug is to restart TomEE from scratch after each 
deployment.  Set bug level to critical since this makes hot deploy very risky 
if it is not picking up every change in the deployment. 


> schedular changes do not  Hot Deploy 
> -------------------------------------
>
>                 Key: TOMEE-3801
>                 URL: https://issues.apache.org/jira/browse/TOMEE-3801
>             Project: TomEE
>          Issue Type: Bug
>          Components: TomEE Core Server
>    Affects Versions: 8.0.6, 8.0.7, 8.0.8
>            Reporter: Tony Weston
>            Priority: Critical
>         Attachments: schedular bug.mp4
>
>
> Hot deploy, with changes to scheduled methods with @schedule, or 
> programatically using Timer and @timeout ,  does not update previously 
> deployed scheduled config.
> This is reproducible by using this class:
> *package* bug;
>  
> {{*import* java.util.Date;}}{{ }}
>  {{*import* javax.ejb.Schedule;}}
>  {{*import* javax.ejb.Singleton;}}{{ }}
>  {{@Singleton }}
>  {{*public* *class* TestSchedular {}}{{ }}
>  {{    @Schedule(second = "*/2", minute="*", hour="*" )}}
>  {{    *public* *void* doIt() {}}
>  {{       System.*_out_*.println("Fired at "+*new* Date());}}
>          }
>  {{}}}
> Deploy to tomee.  Then update the class with a new timing,  say 4 seconds.  
> compile, and deploy the new war to Tomee.    Tomee will continue to use the 
> the previous 2 second timing after hot-deploy.
> Attached file is a video of this happening in Eclipse, as its very easy to 
> demonstrate, though this bug is absolutely present in a stand alone TomEE 
> server.   The video starts with the schedule set to 2 seconds. After changing 
> to 4 seconds, and tomee restarting, the scheduled method continues to fire 
> every 2 seconds.
> A work around for this bug is to restart TomEE from scratch after each 
> deployment.  Set bug level to critical since this makes hot deploy very risky 
> if it is not picking up every change in the deployment. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to