• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Restart of database server

 
Thara Visu
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • 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.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4031
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • 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
Saloon Keeper
Posts: 4031
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks.
So what is the whole concept of Stale Connections?
 
Scott Selikoff
author
Saloon Keeper
Posts: 4031
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • 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
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic