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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:13:55+00:00 2026-06-13T23:13:55+00:00

I have a 3-tiered application with Glassfish 3.1.2.2, MySQL database and a Swing client

  • 0

I have a 3-tiered application with Glassfish 3.1.2.2, MySQL database and a Swing client application. Is it somehow possible to handle a database server crash?

I tried to stop the MySQL service during my application is running. Then I get javax.ejb.EJBAccessException exceptions everytime I try to access the database through one of my facade session beans.

I want to notify the user that the database is currently down. furthermore i want to set my application in kind of a “sleep-mode” until the database is up and running again.

What would be a good (and possibly easy) approach to handle such a scenario?

Thanks for your help in advance!

  • 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-13T23:13:55+00:00Added an answer on June 13, 2026 at 11:13 pm

    A) Ensure you configure Glassfish Connection Pool for automatic recovery/reconnection

    In the Glassfish JDBC connection pool configuration, set the values for:

    • Attributes: is-connection-validation-required, validate-atmost-once-period-in-seconds, connection-creation-retry-attempts, connection-validation-method, connection-creation-retry-interval-in-seconds, ping

    Glassfish Configuration jdbc-connection-pool Properties
    Glassfish Admin – create-jdbc-connection-pool subcommand

    Steps:

    1. Assuming Glassfish is running (e.g. start server in Netbeans Services Tab, by opening Servers and right-clicking Glassfish), then you should have the Domain Admin Server running
    2. Open Admin Console in web browser: http://localhost:4848 (or use whatever port you specified during install.
    3. On left, under Common Tasks menu, open Resources -> JDBC and click on JDBC Connection Pools
    4. Click on your connection pool POOL NAME (or create a new one by clicking New button)
    5. Select Advanced Tab & Enter:
    6. Validate At Most Once: (e.g. 60) in seconds
    7. Creation Retry Attempts: (e.g. 3)
    8. Retry Interval: (e.g. 10) in seconds
    9. Connection Validation: (Tick) Required
    10. Validation Method: (e.g. auto-commit)
    11. Other Advanced Properties as Desired
    12. Select General Tab & Enter:
    13. Ping (Tick)
    14. Other General Properties as Desired

    B) Implement Application Error Handling / DB Monitoring & Alerts

    1. Mandatory: trap “infrastructure-level” fatal user errors and alert support staff.

      Create a simple JMX class to send a notification & call its method
      when a fatal error occurs JMX MBean Class which sends notifications. You can use a JMX monitor console to observe state of servers – some of these consoles send email alerts (e.g. JManage and RHQ) and there are bridges for access from HTTP/AJax or other languages (e.g. Jolokia can use javascript/perl/java API to access JMX notifications).

      Use Google Calendar API to send the error msg to support staff’s google calendar (1 or 2 mins into future). Then configure google calendar to send email/sms notifications – will give error alert straight to support staff in near-realtime. This is subject to Google usage restrictions (a courtesy limit of 10,000 queries per day, so make sure your apps not super buggy and use logic to limit the number of messages sent in an hour/day/week)

    2. Desirable: monitor DB (& probably app server) and alert support staff of outages

      • Zabbix open source has inbuilt mySQL monitoring and alerting – is lightweight but requires setup & configuration
      • Hyperic open source has extension plug-ins for mySQL monitoring and inbuilt alerting – is heavy-weight, can be complex to setup & configure
      • Nagois open source is the default for *nix OSes – is heavy weight, can be complex to setup and configure

      In all cases, setup will not happen instantly – best to implement as a separate mini project & do it right – best to have support staff involved in this.

      If these are “out of scope”, then create your own simple monitor:

      • An EJB timer to run scheduled simple test query against your DB – if it fails send an alert (via JMX/Google Calendar/Java Mail/ SMS gateway API). Or use Quartz open source scheduler to do the same job
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tiered application. The datalayer makes a call to the database by
I have a multi tiered SOA application and a database with over 100 tables.
We have an application, n-tier like structured, but I wouldn't say it's n-tiered. The
For typical 3-tiered application, I have seen that in many cases they use a
I'm working on the client side application of the client/server chat I'm doing for
We have an application server developed with Delphi 2010 and Indy 10. This server
I'm working on setting up log4net in a multi-tiered application. I have most of
i have created a application in VB6.0 which is connected to MySQL through ODBC
For our enterprise application, we have tiered streams in AccuRev (developers promote to the
I have 2 Activities in my client/server project: 1 - login (openning connection) 2

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.