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 8088993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:15:42+00:00 2026-06-05T19:15:42+00:00

Sometimes, tomcat restart will cause my application stop immediately so that my consuming data

  • 0

Sometimes, tomcat restart will cause my application stop immediately so that my consuming data in oracle db keep one error state. So I want know if has any methods to help handling the state once the tomcat stop. Due to unknown the actual events happen on the stop procedure of tomcat. I can’t know how to make sure something happen when tomcat stopped.

  • 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-06-05T19:15:46+00:00Added an answer on June 5, 2026 at 7:15 pm

    If you are doing a normal restart you should be able to register a shutdownhook and have it run before the server kills the app.

    Check out the javadocs for more detailed info: http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html#addShutdownHook(java.lang.Thread).

    You can add a shutdown hook like this:

    Runtime.getRuntime().addShutdownHook(new Thread(new Runnable(){
        public void run() {
             // clean-up logic
        }
    }));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an init servlet in Tomcat that loads critical data. Sometimes it is
am working on a java(tomcat) app. that sometimes writes to stdout. But I notice
multiple webapp running on same tomcat using same jvm. sometime, one webapp that have
We have a Spring application that is hosted on a shared tomcat instance .
I have a web application setup using tomcat. Sometimes a little icon appears in
We are running tomcat application server that handle over 100 concurrent sessions. In the
There is a Java Struts application running on Tomcat, that have some memory errors.
Sometimes I got error saying that unrecognized selector objcType was sent to an NSDate
We have a web application which sometimes (quite rarely, several times a day) gives
I am streaming out data (sometimes png, sometimes json, sometimes xml) and I get

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.