0

In our setup, we have two containers

  1. Tomcat running on Linux Container
  2. DB running on another Linux container

If the servlet running under tomcat is not able to reach DB container via hibernate. After retries,Should we call System.exit in Servlet ?

yogishaj
  • 705
  • 5
  • 17
  • 1
    Certainly not. You can't assume you're the only servlet running, or that you have permission to call `System.exit()`, or that exiting the entire Tomcat is the correct response to a possibly temporary condtion. – user207421 Nov 25 '16 at 03:27
  • @EJP to be fair, if it's inside a docker container, it's probably the only one running. – Roman Nov 25 '16 at 04:36
  • I am not an expert on Tomcat but can you share more info on how are you staring the container. And how are you reaching out DB via its name or IP. – Neependra Khare Nov 25 '16 at 04:57
  • @EJP Tomcat is running only to service; Webservice requests. The Webservice depends on another container which runs a DB. In general, If a Tomcat/any other application running in a container is not able to reach another container running DB, should the application retry and exit? – yogishaj Nov 25 '16 at 06:48

0 Answers0