Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6977733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:39:49+00:00 2026-05-27T17:39:49+00:00

I use EJB3.1 TimerService to schedule timers in Java. Is there a common way

  • 0

I use EJB3.1 TimerService to schedule timers in Java.

Is there a common way to prevent running 2 simultaneous timer instances?
Lets say my timer fires every 5 minutes. If for some reason timer started running at 5:00 and finished running at 5:07, I want to run next time at 5:12 (or at 5:10, just skip the timeout at 5:05).
Is there an easy/built-in way to do it?

thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:39:49+00:00Added an answer on May 27, 2026 at 5:39 pm

    Just have the process reschedule itself on completion rather than scheduling them all up at once.

    Alternatively, you could have a shared semaphore that blocks one job while the other job is running. If it’s rare for a job to stall the full 5 minutes, this is a simple fix. If it’s not rare, then the jobs will stack up and get out of sync, as the timer will continue to start knew jobs even if there are blocked ones already.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just about to use the new EJB3 TimerService (as part of Java EE
In EJB3 Timer Service, I can create the timer with the timerService.createTimer(...) function, but
There are so many things are common in in EJB3 and Spring 3 with
'''use Jython''' import shutil print dir(shutil) There is no, shutil.move, how does one move
I want to create a timer EJB3 when a stateless bean is created in
At http://www.java2s.com/Code/Java/EJB3/EJBtutorialfromJBossAsynchronouscall.htm i've found an example showing how to call ejb methods in asynchronous
I'm learning EJB3 and I'm just curious when it's convenient to use SFSB? I
I'm upgrading an application from an old ejb2 setup to use ejb3's using the
I have an app that take long time to deploy/redeploy because this use EJB3,
I want to use an EJB3 from within my Tapestry Page class, I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.