I would like to use a stateful session bean to maintain state within the business tier. I tried putting a reference to the SFSB onto the HTTP session, yet this lead to ConcurrentAccessException during double clicks, HTML frames etc. I understand from several posts I found online that there are a number of options.
1.) Handle the exception on the presentation / web tier
This option would make the presentation tier more complex
2.) Move the state to the presentation / web tier
This polutes the responsibilities of each tier and will have impact on performance as the state has to be passed between the two tiers
3.) Synchronize around SFSB invocation
This will work, but somehow does not feel right. It would be nice if there was a client side interception layer which could do this for me though.
4.) Use Stateless beans and store the state in a cache
This introduces the complexity of managing the cache on the business tier and the burden of passing the key to the cache between the two tiers.
I have also come across the Conversation Session Scope which is used in several examples. I am wondering if this offers a solution, or if it simply changes the granularity of the problem.
Several posts seem to allude to an elegant solution, jet don't provide the details. Please could somebody direct me to a nice elegant solution to this problem.
Thanks in advance.
In Seam 1.1, Seam synchronizes requests to the same conversation, avoiding these problems.