jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1055134 - in /jackrabbit/trunk/jackrabbit-webapp/src/main: java/org/apache/jackrabbit/j2ee/DerbyShutdown.java webapp/WEB-INF/web.xml
Date Tue, 04 Jan 2011 18:34:00 GMT
Author: jukka
Date: Tue Jan  4 18:33:59 2011
New Revision: 1055134

URL: http://svn.apache.org/viewvc?rev=1055134&view=rev
Log:
JCR-1301: Trouble undeploying jackrabbit-webapp from Tomcat

Improved comments

Modified:
    jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/DerbyShutdown.java
    jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/web.xml

Modified: jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/DerbyShutdown.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/DerbyShutdown.java?rev=1055134&r1=1055133&r2=1055134&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/DerbyShutdown.java
(original)
+++ jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/DerbyShutdown.java
Tue Jan  4 18:33:59 2011
@@ -26,8 +26,8 @@ import javax.servlet.ServletContextListe
 
 /**
  * Servlet context listener that releases all remaining Derby resources
- * when the web application is undeployed. Should only be used when the
- * Derby library has been deployed as a part of this webapp.
+ * when the web application is undeployed. The resources are released only
+ * if the Derby classes were loaded from within this webapp.
  *
  * @see <a href="https://issues.apache.org/jira/browse/JCR-1301">JCR-1301</a>
  */
@@ -39,10 +39,14 @@ public class DerbyShutdown implements Se
     public void contextDestroyed(ServletContextEvent event) {
         try {
             String shutdown = "jdbc:derby:;shutdown=true";
+            // Try to find the Derby JDBC driver
             Driver driver = DriverManager.getDriver(shutdown);
+            // Check if the Derby driver comes from this webapp
             if (driver.getClass().getClassLoader()
                     == DerbyShutdown.class.getClassLoader()) {
+                // Unregister the automatically loaded driver
                 DriverManager.deregisterDriver(driver);
+                // Tell Derby to release all remaining resources
                 driver.connect(shutdown, new Properties());
             }
         } catch (SQLException ignore) {

Modified: jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/web.xml?rev=1055134&r1=1055133&r2=1055134&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/web.xml (original)
+++ jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/web.xml Tue Jan  4 18:33:59
2011
@@ -22,9 +22,6 @@
 
     <listener>
         <!-- Releases all Derby resources when the webapp is undeployed.  -->
-        <!-- You should comment out this entry if you are not using Derby -->
-        <!-- for Jackrabbit persistence, or if you've deployed the Derby  -->
-        <!-- outside the Jackrabbit webapp.                               -->
         <!-- See https://issues.apache.org/jira/browse/JCR-1301           -->
         <listener-class>
             org.apache.jackrabbit.j2ee.DerbyShutdown



Mime
View raw message