Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

databse in Read mode

 
Ram kovis
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if the database is in read mode or update mode, how can we know it from java side? Is there any API for that?
we have some daily load programs running during night . During that time, the DBA wants to make the database in READ mode , so that online applicaiton cannot access the data and modify it. BUt my question is, how can we know from Java side, whether the database in Read mode or update mode. If we can know this, I want to throw the user a warning page saying that the data is loading .. please try after sometime..
Thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ram,
You could have a table in the database that contains the current mode. Then applications could query it to see if they can make updates. Alternatively, you could catch exceptions and assume that if an exception is thrown, the database is in read mode.

Depending on your application, it may be worth considering making the downtime transparent to the user. For example, if the user is ordering something, you don't want him/her to go away because the user may never come back. In this case, you could write to a file and later record the transaction in the database.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic