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

        Ted Goddard created issue -
        Ken Fyten made changes -
        Field Original Value New Value
        Fix Version/s 1.6 [ 10031 ]
        Assignee Priority P1
        Assignee Mircea Toma [ mircea.toma ]
        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).
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #14225 Thu Jun 21 11:37:11 MDT 2007 mircea.toma Synchonize service methhod call -- ICE-1765.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ViewBoundAdaptingServlet.java
        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.
        Mircea Toma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 1.6DR#6 [ 10090 ]
        Fix Version/s 1.6 [ 10031 ]
        Ken Fyten made changes -
        Fix Version/s 1.6 [ 10031 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Priority P1
        Assignee Mircea Toma [ mircea.toma ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: