4 Replies Latest reply on Mar 12, 2008 10:50 AM by pmuir

    Why is searchAction of the Booking example Session scoped?

    gduq

      I built my application using the Booking example as a template but I my search action is occasionally getting a IllegalStateException: could not acquire lock on @Synchronized component This is only happening in production, and I can't reproduce it.  I am thinking about making the search action conversation scoped in the hope that it will fix it but I'd like to understand why it was session scoped to start with.

        • 1. Re: Why is searchAction of the Booking example Session scoped?
          admin.admin.email.tld

          Probably because of this bug


          http://jira.jboss.com/jira/browse/JBSEAM-2501


          From my investigation, it appears that the action requires session scope for the pageNo value and to place it in session scope is certainly overkill for one little int.  Especially since the bean contains a collection.

          • 2. Re: Why is searchAction of the Booking example Session scoped?
            pmuir

            As explained many times, it is session scoped because that WAS THE DESIGN (that the search is remembered whilst the user is logged in).


            And there is no bug in Seam in JBSEAM-2501, just in your understanding. How do you expect the search results to be remembered between requests for paging? Btw if you want to not use the session scope, take a look at a sea-gen'd app (it uses the request scope).

            • 3. Re: Why is searchAction of the Booking example Session scoped?
              gduq

              As explained many times, it is session scoped because that WAS THE DESIGN (that the search is remembered whilst the user is logged in).

              Thanks for explaining that.  I can understand that design trade-off but am I correct in thinking that there isn't any reason that this couldn't work as a long running conversation?


              I tried doing it this way but experienced some strange behavior that  sounds similar to what Mark mentioned.

              • 4. Re: Why is searchAction of the Booking example Session scoped?
                pmuir

                Certainly, it would work as a long running conversation. (You might well need to recode some bits).


                But bear in mind that you would probably want a new conversation for booking the hotel.


                I wouldn't normally use a LRC here as paging hotels doesn't represent a logical unit of work for the user (either it's open ended, so should be done using paramters or it should be session scoped).