Reputation: 2519
During the rather larges xPages application development a realized the fact that Domino deletes alls sessionScope, viewScope, applicationScope variables in application after any change in application design(that causes some internal application reload on server). I understand this for development process, but its realy unacceptable in production because it makes inconsistences for connected users. Even simple typo correction in code or on xpage(on any xpage, not the one the user is working on) and applying changes to production application causes this deletes. Is there a way how to overcome this behaviour? (I know I can update application outside of business hours or something but its problem for new application when you need to deliver changes quickly e.g. typo fixes ...)
Upvotes: 4
Views: 447
Reputation: 3524
jjtbsomhorst explained the reason. I want to add: don't rely on scoped variables and use beans. Beans contain "formula for cooking a fresh one" what is much safer for application. Any scoped variable computed on specific event (on load typically) will be lost forever, if you make update to application as mentioned in your question. But if you used bean - its values will be recreated whenever needed again.
Upvotes: 0
Reputation: 8086
This answer to a previous question might provide an option for you. In the context of the original question, the suggestion for defining listeners was just to provide an opportunity to do some cleanup prior to the scopes being destroyed. These types of listeners, however, could also be used to save and restore the state of these scopes. I'd urge caution for the reasons JJTB mentions, but certainly in situations where you're making completely unrelated changes (e.g. structural, not logical), this would give you a way to prevent users from being impacted by frequent scope clearing.
Upvotes: 2
Reputation: 1667
This has to be done because any changes in your application could cause the scoped variables ( and its contents) to invalidate. Updating an application ( any not only xpage apps ) should be done in a specified trimeframe at which there are none / limited amount of users.
Upvotes: 6