• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Restart of database server

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Assume a situation where the database server is restarted. Will a website on the server work without any problem i.e will the app server be able to detect if the database server is up or not or would we have to restart the app server?

Thanks in advance.
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some servers would pick up the missing database immediately and start producing errors to the servers log file. This is usually the case if you use standard data sources such as in J2EE.

Other servers (or if the database connection is hard-coded via JDBC calls in the application code) would only detect errors if database queries were issued while the database was down. After all, you can't run queries on a server that isn't available.

In all cases though, the application server should be able to detect when the database server is back up and start working again. The only downside is that if you have any cached objects from the database on the application server, they may need to be resynched, ergo a restart of the application server may be required if your persistence manager does not handle this.
[ December 07, 2005: Message edited by: Scott Selikoff ]
 
Scott Selikoff
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh and as a side note, application servers restart far more frequently than database servers (which I almost never restart) so its probably a good practice to take the application server down if you are restarting the database. In most situations, there's not much an application server can do while its database is down anyway.
[ December 07, 2005: Message edited by: Scott Selikoff ]
 
Thara Visu
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.
So what is the whole concept of Stale Connections?
 
Scott Selikoff
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's just the name or type of exception an application is going to receive while the database is unavailable from the Connection object. A new Connection object must be established after some specified retry delay, or a failure must be reported to the user.

Also, if this is a WebSphere server check out:
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/rdat_stalconexp.html
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's more, database connections are just fancy network connections, which sometimes are dropped for no discernible reason. So even if the DB is up all the time, the connection can go stale. That's why any decent DB connection pool will close and reopen DB connections every so often.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic