You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2008/08/19 17:08:02 UTC
svn commit: r687071 -
/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/jsf/ContextLockRequestHandler.java
Author: skitching
Date: Tue Aug 19 08:08:02 2008
New Revision: 687071
URL: http://svn.apache.org/viewvc?rev=687071&view=rev
Log:
Update comments only
Modified:
myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/jsf/ContextLockRequestHandler.java
Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/jsf/ContextLockRequestHandler.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/jsf/ContextLockRequestHandler.java?rev=687071&r1=687070&r2=687071&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/jsf/ContextLockRequestHandler.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/jsf/ContextLockRequestHandler.java Tue Aug 19 08:08:02 2008
@@ -48,18 +48,23 @@
{
// Fetch the ConversationManager instance for the current HttpSession.
//
- // We do not want to create a ConversationManager instance if one does
- // not exist; that would force an HttpSession to be created in webapps
- // where Orchestra usage only occurs in a small part of the webapp; if
- // the user doesn't visit that part of the app we should not force a
- // session and ConversationManager to be created until they do need it.
- // Hmm..but and JSF component that writes out a URL will trigger the
- // creation of a ConversationManager instance, as the contextId is
- // currently encoded into each url (see ConversationRequestParameterProvider).
- // So avoiding creating it here is probably not very important..
+ // We do not want to create a ConversationManager instance if one does not exist; that would force an
+ // HttpSession to be created in webapps where Orchestra usage only occurs in a small part of the webapp;
+ // if the user doesn't visit that part of the app we should not force a session and ConversationManager
+ // to be created until they do need it.
//
- // Note that ConversationManager.getInstance requires the FrameworkAdapter
- // to be initialized.
+ // We also should avoid creating an HttpSession unless one exists (and creating a ConversationManager
+ // instance requires a session). This is particularly useful for applications that have cookies turned
+ // off (ie use a jsessionid value encoded in the url). In this case, weblets requests will not have
+ // the jsessionid but do trigger the creation of a FacesContext, and therefore run this code. If we
+ // create a session here, then we will create a separate session for each and every weblets resource
+ // request - and they will live until the webapp session timeout expires. Bad. Very bad.
+ //
+ // Note that if the request being processed includes any code that uses FacesContext.responseWriter
+ // then that invokes the ConversationRequestParameterProvider. And that always writes out a contextId
+ // which in turn requires creating a ConversationManager. But there are value requests that run the
+ //
+ // Note that ConversationManager.getInstance requires the FrameworkAdapter to be initialized.
ConversationManager manager = ConversationManager.getInstance(false);
if (manager != null)
{