I am building a web app that allows users to create and edit records. The forms are somewhat complex with a lot of fields, and use heavy partial page rendering for adding and removing entries. The managed beans are session-scope.
Here is the perhaps familiar problem related to session-scoped beans: when a user opens more than one browser, bean data from one browser is unsafely altering the state of the other browser.
For example, if a user opens record A in browser #1, and then opens record B in browser #2, then record A will be over-written in the session. Browser #1 is now an invalid view of the current session data, and doing anything in this window will have unknown results.
This is an unfortunate side-effect of having session-scoped managed beans. And yet request beans just don't cut it for the amount of data and the amount of processing being done. For example, even before the record is ready to be submitted and saved, there is a ton of partial-page requests to add more fields, do custom validation, etc.
Ideally, I'd like only user information to be session-scoped (if a user logs in in one browser, and opens another browser, that one is also logged in. This bean works perfectly fine as a session bean). But individual records should have a feel of being request-scoped (a user should be able to edit two different records in two browsers; does not work so well as a session-bean). My attempt to rework this data into a request-scoped bean convinced me that it can't be done short of passing tons and tons of data back and forth with every action, and is therefore impractical, so there I am stuck.
I'm looking for solutions or alternative approaches. Any insight would be appreciated!
I'm using
JSF 1.2 + Facelets + Trinidad.
Note: I've seen something called pageFlowScope mentioned in Trinidad's documentation. This is the closest thing I've found to a potential solution, but unfortunately it seems primitive and cumbersome. I've hit a dead-end looking into it - as complete as Trinidad's documentation is, much of it is briefly mentioned with no examples or resources to go with it. But if anyone has had success with this, please let me know.