ICEfaces
  1. ICEfaces
  2. ICE-1765

concurrent user events may cause data corruption

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6DR#5
    • Fix Version/s: 1.6DR#6, 1.6
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces 1.6DR5, Seam 1.2

      Description


      Rapidly clicking on a button causes exceptions to be thrown

       13:33:50,218 ERROR [D2DFaceletViewHandler] Problem in renderResponse:
            /pricing/viewAdjustPremium.jspx @39,80 itemValue="${layer.value}":
            /pricing/viewAdjustPremium.jspx @38,110 items="#{ctrl.pricingConversation.x}":
            Exception getting value of property pricingConversation of base of type :
            com.agcs.pricing.web.controller.ViewAdjustPremiumController_$$_javassist_39
       javax.faces.el.EvaluationException: /pricing/viewAdjustPremium.jspx @39,80 itemValue="${x.value}":
            /pricing/viewAdjustPremium.jspx @38,110 items="#{viewadjustpremiumcontroller.pricingConversation.x}":
            Exception getting value of property pricingConversation of base of type :
            com.agcs.pricing.web.controller.ViewAdjustPremiumController_$$_javassist_39
            at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60)
            ....

      The following change has been suggested, however, synchronization must be considered carefully as it can lead to deadlock or performance problems:

       public class ViewBoundAdaptingServlet extends BasicAdaptingServlet {
       
           synchronized public void service(HttpServletRequest request, HttpServletResponse response) throws Exception {
              ...
           }
       }

        Activity

        Hide
        Ted Goddard added a comment -

        To reproduce, go to register.seam in the booking application, click in a field, and hold the tab key down. After a few moments, concurrent partialSubmit execution will throw the following exception:

        09:33:30,934 ERROR [SeamPhaseListener] uncaught exception
        java.lang.IllegalStateException: No active application scope
        at org.jboss.seam.core.Init.instance(Init.java:88)
        at org.jboss.seam.jsf.TransactionalSeamPhaseListener.handleTransactionsBeforePhase(TransactionalSeamPhaseListener.java:25)
        at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:52)
        at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
        at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCyclePartial(ReceiveSendUpdates.java:69)
        at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:43)
        at com.icesoft.faces.webapp.http.core.IDVerifier.service(IDVerifier.java:25)
        at com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:16)
        at com.icesoft.faces.webapp.http.servlet.ViewBoundAdaptingServlet.service(ViewBoundAdaptingServlet.java:29)
        at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
        at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
        at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:93)
        at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:35)
        at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
        at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
        at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:85)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        ...

        Show
        Ted Goddard added a comment - To reproduce, go to register.seam in the booking application, click in a field, and hold the tab key down. After a few moments, concurrent partialSubmit execution will throw the following exception: 09:33:30,934 ERROR [SeamPhaseListener] uncaught exception java.lang.IllegalStateException: No active application scope at org.jboss.seam.core.Init.instance(Init.java:88) at org.jboss.seam.jsf.TransactionalSeamPhaseListener.handleTransactionsBeforePhase(TransactionalSeamPhaseListener.java:25) at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:52) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144) at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCyclePartial(ReceiveSendUpdates.java:69) at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:43) at com.icesoft.faces.webapp.http.core.IDVerifier.service(IDVerifier.java:25) at com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:16) at com.icesoft.faces.webapp.http.servlet.ViewBoundAdaptingServlet.service(ViewBoundAdaptingServlet.java:29) at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52) at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29) at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:93) at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:35) at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52) at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29) at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:85) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) ...
        Hide
        Ted Goddard added a comment -

        The suggested fix may be reasonable for the following reason:

        • ViewBoundAdaptingServlet is instantiated per session (per view?) hence will not cause synchronization to span multiple users leading to poor performance

        If ViewBoundAdaptingServlet is used for blocking requests, however, synchronizing this method could lead to deadlock (except in synchronous mode).

        Show
        Ted Goddard added a comment - The suggested fix may be reasonable for the following reason: ViewBoundAdaptingServlet is instantiated per session (per view?) hence will not cause synchronization to span multiple users leading to poor performance If ViewBoundAdaptingServlet is used for blocking requests, however, synchronizing this method could lead to deadlock (except in synchronous mode).
        Hide
        Mircea Toma added a comment -

        Making the "service" method synchronized is good enough for now.
        It looks like that when the "service" method is run by two different threads one of them will trigger "view.release()" which will clear-up data that the other thread is still working with.

        Show
        Mircea Toma added a comment - Making the "service" method synchronized is good enough for now. It looks like that when the "service" method is run by two different threads one of them will trigger "view.release()" which will clear-up data that the other thread is still working with.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: