[seam-commits] Seam SVN: r14044 - in branches/community/Seam_2_2: src/resteasy/org/jboss/seam/resteasy and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Feb 15 07:10:45 EST 2011


Author: jharting
Date: 2011-02-15 07:10:45 -0500 (Tue, 15 Feb 2011)
New Revision: 14044

Modified:
   branches/community/Seam_2_2/examples/tasks/resources/WEB-INF/components.xml
   branches/community/Seam_2_2/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java
Log:
JBSEAM-4775

Modified: branches/community/Seam_2_2/examples/tasks/resources/WEB-INF/components.xml
===================================================================
--- branches/community/Seam_2_2/examples/tasks/resources/WEB-INF/components.xml	2011-02-15 11:18:54 UTC (rev 14043)
+++ branches/community/Seam_2_2/examples/tasks/resources/WEB-INF/components.xml	2011-02-15 12:10:45 UTC (rev 14044)
@@ -43,7 +43,7 @@
 		entity-class="org.jboss.seam.example.tasks.entity.Category"
 		media-types="application/xml application/json application/fastinfoset"/>
 
-	<resteasy:application resource-path-prefix="/v1" destroy-session-after-request="false">
+	<resteasy:application resource-path-prefix="/v1" destroy-session-after-request="true">
 		<resteasy:media-type-mappings>
 			<key>xml</key>
 			<value>application/xml</value>

Modified: branches/community/Seam_2_2/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java
===================================================================
--- branches/community/Seam_2_2/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java	2011-02-15 11:18:54 UTC (rev 14043)
+++ branches/community/Seam_2_2/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java	2011-02-15 12:10:45 UTC (rev 14044)
@@ -146,8 +146,13 @@
                }
                finally
                {
-                  // Prevent anemic sessions clog up the server
-                  if (application.isDestroySessionAfterRequest())
+                  /*
+                   * Prevent anemic sessions clog up the server
+                   * 
+                   * session.isNew() check - do not close non-anemic sessions established by the view layer (JSF)
+                   * which are reused by the JAX-RS requests (so that the requests do not have to be re-authorized)
+                   */
+                  if (application.isDestroySessionAfterRequest() && request.getSession().isNew())
                   {
                      log.debug("Destroying HttpSession after REST request");
                      Session.instance().invalidate();



More information about the seam-commits mailing list