• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts-config change/redeploy application object

 
azhar bharat
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
If I change the struts-config xml file, do i have to redeploy the application for the changes in config file to take effect?

The problem is, if i redeploy the application, some data in the application object, representing the state of the application will be lost.

Do I have to manually backup the data and re-populate in the application object after redepolyment? Or is there any other way automate the process?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I change the struts-config xml file, do i have to redeploy the application for the changes in config file to take effect?

Yes, you do. There's no getting around it.
The problem is, if i redeploy the application, some data in the application object, representing the state of the application will be lost.

It's not a good design to rely on the Application (ServletContext) object for persistent data. It's fine to use this object as a kind of cache to keep the number of database hits low, but anything you want to keep should be written to a database first and then cached in the Applicaiton object. The server could go down unexpectedly at any time. A good design plans for that possibility. Data written to a relational database is recoverable if the server fails. Data in memory is not.
[ August 12, 2006: Message edited by: Merrill Higginson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic