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

  • Home
  • SEARCH
  • 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 1105099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:34:42+00:00 2026-05-17T01:34:42+00:00

My problem is this: Google App Engine allows cron jobs to be active for

  • 0

My problem is this:
Google App Engine allows cron jobs to be active for only 30 seconds before an DeadlineExceededException is thrown. And my app that isn’t suited for the google app engine platform from this point of view, needs to call a time-consuming cron job.
One solution that I figured out was to calling another Servlet (Servlet2) and let that Servlet2 do the job for me, Servlet_2 would be a regular Java Servlet.
To achieve that, I was thinking of creating a session from my cron job Servlet_1, call the other Servlet_2, test the session and then let the server do the jobs required and in the end invalidate the session.
The call from Servlet_1 should not be redirecting to Servlet_2, because that will put me back in square one again.

Now to my question: Do you think this will work? And if yes and an DeadlineExceededException acure, would the Servlet_2 stop from working as well, even if I put all the code in the destroy method of the Servlet_2?
my code:

//Servlet_1
try {
   HttpSession session = request.getSession(true);
   session.setAttribute("referingPage", "server is calling");
   request.getRequestDispatcher("/Servlet_2.do").forward(request, response);
}catch(DeadlineExceededException e) {
   e.printStackTrace();
}


//Servlet_2
@Override
public void destroy() {
   HttpSession session = request.getSession(true);
   String value = (String)session.getAttribute("referringPage");
   if(value.equals("server is calling")) {
    // Do the time demanding stuff
   }
   session.invalidate();
}

Would be grateful for an answer!

  • 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-17T01:34:43+00:00Added an answer on May 17, 2026 at 1:34 am

    You only have 30 seconds to produce finish execution and there’s no way around that. Doing a forward doesn’t spawn a new thread or anything, it’s still executing within the 30 second time limit.

    I’d try to figure out some way to serialize what you’re doing, or pause it and stick your state in memcache. When you start processing again, check memcache to see if you need to pick up form where you left off.

    Google App Engine is working on long running background processes, and I hope then come out with a solution soon. I’m in the same boat.

    Mark

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

Sidebar

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.