Issue Details (XML | Word | Printable)

Key: ICE-1765
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Ted Goddard
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ICEfaces

concurrent user events may cause data corruption

Created: 21/Jun/07 10:09 AM   Updated: 05/Jul/07 03:49 PM
Component/s: Framework
Affects Version/s: 1.6DR#5
Fix Version/s: 1.6DR#6, 1.6

Environment: ICEfaces 1.6DR5, Seam 1.2

ICEsoft Forum Reference: http://www.icefaces.org/JForum/posts/list/4842.page


 Description  « Hide

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 {
        ...
     }
 }



 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Ted Goddard added a comment - 21/Jun/07 10:36 AM

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)
...



Ted Goddard added a comment - 21/Jun/07 11:05 AM
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).


Mircea Toma added a comment - 21/Jun/07 12:42 PM
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.