I was (using tapestry 3.0.3) trying to chase down the “locked after a 
commit” problem yesterday and I found three different solutions:

1. Make a request filter as per:
http://www.onjava.com/pub/a/onjava/2004/03/24/loadcontrol.html?page=2

Problem detailed below…

2. Change the engine to squash the exception:

I don’t like squelching exceptions, I’d prefer they not happen at all.

3. Write JavaScript to prevent multiple clicking.

We have multiple nav menu’s/access points, doing so would be a real pain.


So, I implemented the Request Filter as mentioned in the On Java article. 
From my casual testing this morning it seems to work fine and dandy, until 
I click logout.  My logout is a simple Engine.restart, but when that 
occurs I get the following exception:

java.lang.IllegalStateException: Cannot create a session after the 
response has been committed
 
org.apache.coyote.tomcat5.CoyoteRequest.doGetSession(CoyoteRequest.java:2270)
 
org.apache.coyote.tomcat5.CoyoteRequest.getSession(CoyoteRequest.java:2116)
 
org.apache.coyote.tomcat5.CoyoteRequestFacade.getSession(CoyoteRequestFacade.java:526)
 
org.apache.coyote.tomcat5.CoyoteRequestFacade.getSession(CoyoteRequestFacade.java:531)
 
com.expd.app.frm.util.RequestControlFilter.releaseQueuedRequest(RequestControlFilter.java:202)
 
com.expd.app.frm.util.RequestControlFilter.doFilter(RequestControlFilter.java:160)

The culprit seems to be:

  private void releaseQueuedRequest( HttpServletRequest request )
  {
    HttpSession session = request.getSession();
    …
}

I guess I could come up with a work around avoiding engine restart, but 
I'd really like to clean house when the user clicks logout.

Any ideas/resolutions?

Thanks.

Reply via email to