You gotta love this Romain guy, a fix for this, a fix for
that...even/especially when you (have to) throw the Java EE (6)
bible/tutorial (reference implementation) at him! :)

By the way, I love that document...Java EE 6 tutorial; that helped me get
started almost 2 years ago.

On Tue, Mar 5, 2013 at 7:38 AM, Romain Manni-Bucau <[email protected]>wrote:

> Hope https://issues.apache.org/jira/browse/TOMEE-782 will make it better
> (just commited so should be available tomorrow)
>
> *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/3/5 <[email protected]>
>
> > But cron timers with persistent=true should be persisted over JVM
> > restarts. What is the purpose of persistent=true otherwise?
> >
> > http://docs.oracle.com/javaee/6/api/javax/ejb/TimerConfig.html
> > "The persistent property determines whether the corresponding timer has a
> > lifetime that spans the JVM in which it was created. It is optional and
> > defaults to true."
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Romain Manni-Bucau [mailto:[email protected]]
> > Gesendet: Dienstag, 5. März 2013 11:33
> > An: [email protected]
> > Betreff: Re: AW: AW: CalendarTimers created with TimerService and
> > persistent=true are not persisted over tomee restart
> >
> > so jobs are removed at shutdown, so it works
> >
> > *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/3/5 <[email protected]>
> >
> > > Yes, scheduler is stopped correctly.
> > >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Romain Manni-Bucau [mailto:[email protected]]
> > > Gesendet: Montag, 4. März 2013 23:51
> > > An: [email protected]
> > > Betreff: Re: AW: AW: CalendarTimers created with TimerService and
> > > persistent=true are not persisted over tomee restart
> > >
> > > So scheduler is stopped correctly so bit sure there is an issue Le 4
> > > mars
> > > 2013 23:28, <[email protected]> a écrit :
> > >
> > > > I shutdown it normally. Not kill.
> > > >
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: Romain Manni-Bucau [mailto:[email protected]]
> > > > Gesendet: Montag, 4. März 2013 20:26
> > > > An: [email protected]
> > > > Betreff: Re: AW: CalendarTimers created with TimerService and
> > > > persistent=true are not persisted over tomee restart
> > > >
> > > > You shutdown tomee or completely kill it?
> > > > Le 4 mars 2013 19:38, <[email protected]> a écrit :
> > > >
> > > > > You can see all SQL executed in test.db.log. I have tested it with
> > > > > DB2, and it worked same.
> > > > > I have purged DB, then restarted TomEE, scheduled a job and
> > > > > stopped TomEE after a while. Here I've shared collected sql log:
> > > > > https://docs.google.com/file/d/0B1jOAi2N2uY8eTVLblB0NUpaNmM/edit?u
> > > > > sp
> > > > > =s
> > > > > haring
> > > > >
> > > > >
> > > > > -----Ursprüngliche Nachricht-----
> > > > > Von: Romain Manni-Bucau [mailto:[email protected]]
> > > > > Gesendet: Montag, 4. März 2013 19:19
> > > > > An: [email protected]
> > > > > Betreff: Re: CalendarTimers created with TimerService and
> > > > > persistent=true are not persisted over tomee restart
> > > > >
> > > > > clusterRecovering is called in your sample
> > > > >
> > > > > it finds nothing but it is called
> > > > >
> > > > > maybe try a mysql database to see inserts but the logic seems
> > > > > called correctly
> > > > >
> > > > > *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/3/4 <[email protected]>
> > > > >
> > > > > > Shared file here:
> > > > > > https://docs.google.com/file/d/0B1jOAi2N2uY8eTVLblB0NUpaNmM/edit
> > > > > > ?u
> > > > > > sp
> > > > > > =s
> > > > > > haring
> > > > > >
> > > > > >
> > > > > > -----Ursprüngliche Nachricht-----
> > > > > > Von: John D. Ament [mailto:[email protected]]
> > > > > > Gesendet: Montag, 4. März 2013 18:07
> > > > > > An: [email protected]
> > > > > > Betreff: Re: CalendarTimers created with TimerService and
> > > > > > persistent=true are not persisted over tomee restart
> > > > > >
> > > > > > There's no attachment.
> > > > > >
> > > > > >
> > > > > > On Mon, Mar 4, 2013 at 11:16 AM, <[email protected]>
> > > wrote:
> > > > > >
> > > > > > > 4 files are created in project root(I start tomee maven plugin
> > > here):
> > > > > > >
> > > > > > > "\test.db.lck"
> > > > > > > "\test.db.log"
> > > > > > > "\test.db.properties"
> > > > > > > "\test.db.script"
> > > > > > >
> > > > > > > I have purged all this files, then restarted TomEE, scheduled
> > > > > > > a job and stopped TomEE after a while. Please find attached
> > > > test.db.log file.
> > > > > > >
> > > > > > > -----Ursprüngliche Nachricht-----
> > > > > > > Von: John D. Ament [mailto:[email protected]]
> > > > > > > Gesendet: Montag, 4. März 2013 16:56
> > > > > > > An: [email protected]
> > > > > > > Betreff: Re: CalendarTimers created with TimerService and
> > > > > > > persistent=true are not persisted over tomee restart
> > > > > > >
> > > > > > > Yes, that file.  Where does it end up getting created?
> > > > > > >
> > > > > > >
> > > > > > > On Mon, Mar 4, 2013 at 10:49 AM,
> > > > > > > <[email protected]>
> > > > wrote:
> > > > > > >
> > > > > > > > Sorry, don't get your question. Which file do you mean?
> > Test.db?
> > > > > > > >
> > > > > > > > -----Ursprüngliche Nachricht-----
> > > > > > > > Von: John D. Ament [mailto:[email protected]]
> > > > > > > > Gesendet: Montag, 4. März 2013 15:17
> > > > > > > > An: [email protected]
> > > > > > > > Betreff: Re: CalendarTimers created with TimerService and
> > > > > > > > persistent=true are not persisted over tomee restart
> > > > > > > >
> > > > > > > > Are you able to query that file to see the contents? What's
> > > > > > > > in there as your application is running?
> > > > > > > >
> > > > > > > >
> > > > > > > > On Mon, Mar 4, 2013 at 8:12 AM,
> > > > > > > > <[email protected]>
> > > > > wrote:
> > > > > > > >
> > > > > > > > > Hi.
> > > > > > > > >
> > > > > > > > > CalenderTimers created with following code are not
> > > > > > > > > recovered after TomEE restart. Are there some TomEE
> > > > > > > > > properties to make timers persistent across restarts?
> > > > > > > > > There is issue reproduction:
> > > > > > > > > https://github.com/eiskonzept/tomee.git
> > > > > > > > > Just start tomee plugin with node1 profile, open
> > > > > > > > > <context_path>/schedule.xhtml and push "Schedule timer"
> > Button.
> > > > > > > > > Timer is scheduled(executed every second, see log) and
> > > > > > > > > listed on the
> > > > > > > > page.
> > > > > > > > > Restart application, open <context_path>/schedule.xhtml
> > again.
> > > > > > > > > There are no scheduled timers.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Regards.
> > > > > > > > > Dmitry Volkov.
> > > > > > > > >
> > > > > > > > > Timer creation:
> > > > > > > > >     @Resource
> > > > > > > > >     private TimerService timerService;
> > > > > > > > >
> > > > > > > > >     @Override
> > > > > > > > >     @Timeout
> > > > > > > > >     public void scheduleMe() {
> > > > > > > > >         log.warn("Scheduled method executed. " + new
> > > > > > > Date().toString());
> > > > > > > > >     }
> > > > > > > > >
> > > > > > > > >     @Override
> > > > > > > > >     public void schedule() {
> > > > > > > > >         ScheduleExpression schedule = new
> > ScheduleExpression();
> > > > > > > > >         schedule.hour("*");
> > > > > > > > >         schedule.minute("*");
> > > > > > > > >         schedule.second("*");
> > > > > > > > >         timerService.createCalendarTimer(schedule, new
> > > > > > > > > TimerConfig(null, true));
> > > > > > > > >     }
> > > > > > > > >
> > > > > > > > > Quartz config:
> > > > > > > > >         org.quartz.scheduler.instanceName = myScheduler
> > > > > > > > >         org.quartz.scheduler.instanceId = instance1
> > > > > > > > >
> > > > > > > > >
> > > > > > org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializ
> > > > > > er
> > > > > > =t
> > > > > > ru
> > > > > > e
> > > > > > > > >         org.quartz.scheduler.makeSchedulerThreadDaemon=true
> > > > > > > > >         org.quartz.jobStore.makeThreadsDaemons=true
> > > > > > > > >         org.quartz.jobStore.dataSource = testDS
> > > > > > > > >         org.quartz.jobStore.nonManagedTXDataSource =
> > > testDSNonJta
> > > > > > > > >         org.quartz.threadPool.threadCount = 10
> > > > > > > > >         org.quartz.jobStore.class =
> > > > > > > > > org.quartz.impl.jdbcjobstore.JobStoreCMT
> > > > > > > > >         org.quartz.jobStore.driverDelegateClass =
> > > > > > > > > org.quartz.impl.jdbcjobstore.HSQLDBDelegate
> > > > > > > > >         org.quartz.jobStore.isClustered = true
> > > > > > > > >         org.quartz.jobStore.tablePrefix = QRTZ_
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > org.quartz.dataSource.testDS.jndiURL=java:/jdbc/testDS
> > > > > > > > >
> > > > > > > > > org.quartz.dataSource.testDSNonJta.jndiURL=java:/jdbc/test
> > > > > > > > > DS
> > > > > > > > > No
> > > > > > > > > nJ
> > > > > > > > > ta
> > > > > > > > >
> > > > > > > > > DataSource config:
> > > > > > > > >     <Resource id="jdbc/testDS" type="javax.sql.DataSource">
> > > > > > > > >         JdbcDriver org.hsqldb.jdbcDriver
> > > > > > > > >         JdbcUrl jdbc:hsqldb:file:test.db
> > > > > > > > >         UserName sa
> > > > > > > > >         Password
> > > > > > > > >         JtaManaged true
> > > > > > > > >         ConnectionProperties
> > > > > > > > >     </Resource>
> > > > > > > > >
> > > > > > > > >     <Resource id="jdbc/testDSNonJta"
> > > type="javax.sql.DataSource">
> > > > > > > > >         JdbcDriver org.hsqldb.jdbcDriver
> > > > > > > > >         JdbcUrl jdbc:hsqldb:file:test.db
> > > > > > > > >         UserName sa
> > > > > > > > >         Password
> > > > > > > > >         JtaManaged false
> > > > > > > > >         ConnectionProperties
> > > > > > > > >     </Resource>
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Reply via email to