4

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 ...)

David Marko
  • 2,477
  • 3
  • 27
  • 58
  • I never have this problem regarding sessionScope variables, but I hear similar complaints from my colleague. He uses IE9, whereas I use FF, and maybe his HTTP-sessions are defined differently on his server. – D.Bugger Apr 13 '12 at 14:18

3 Answers3

6

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.

jjtbsomhorst
  • 1,667
  • 11
  • 28
  • I understand that but other servers are serializing/deserializing these objects and can restore application state. This can be real disaster if you do some change accidentaly(even opening production app in designer causes building/recompiling application) and users get lost they data. – David Marko Apr 13 '12 at 10:23
2

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.

Community
  • 1
  • 1
Tim Tripcony
  • 8,056
  • 1
  • 23
  • 34
0

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.

Frantisek Kossuth
  • 3,524
  • 2
  • 23
  • 42