Announcement Announcement Module
Collapse
No announcement yet.
sessionForm=true or false ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • sessionForm=true or false ?

    Who's using the default sessionForm=true and who has set it to false ? Please give me some advices or suggestions to have the best solution with the least tradeoffs.

    From what I can see, this is the impact of setting/leaving the sessionForm to true:
    Advantages:
    - Faster response time as you don't need to recreate your data (using referceData()).
    - Ability to detect duplicate submissions. When sessionForm=false, Spring isn't able to check if the user accidentally double-clicked a page or use the back key and resubmitted the form.

    Disadvantages
    - Less memory consumption. A good practice for obtaining scalable web applications is keeping the session memory low. Especially if the user clicks on a link inside the page that doesn't pass the normal controller, the command object is not removed from the session until the user visits the same controller again. I know there is a new framework (WFNM), but I don't know if it can handle the user having two windows open, nor do I want to introduce another framework, so other suggestions are welcome.
    - No issues when the user uses two windows (or tabs in Firefox).
    - If the business layer throws an exception halfway an operation (for example integrity constraints), your session command object can become corrupted. If the user then corrects the error in the form and resubmits the page, the invalid object is reused, causing strange hibernate errors. I solved this by cloning my session object in this controller, but I would prefer a general solution.

    Thanks, Stefaan.
Working...
X