[jboss-cvs] JBossAS SVN: r63043 - trunk/ejb3/src/main/org/jboss/ejb3.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue May 15 06:50:03 EDT 2007


Author: wolfc
Date: 2007-05-15 06:50:03 -0400 (Tue, 15 May 2007)
New Revision: 63043

Modified:
   trunk/ejb3/src/main/org/jboss/ejb3/Ejb3Deployment.java
Log:
EJBTHREE-962: destroy deployment on create failure

Modified: trunk/ejb3/src/main/org/jboss/ejb3/Ejb3Deployment.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/Ejb3Deployment.java	2007-05-15 10:23:26 UTC (rev 63042)
+++ trunk/ejb3/src/main/org/jboss/ejb3/Ejb3Deployment.java	2007-05-15 10:50:03 UTC (rev 63043)
@@ -329,15 +329,30 @@
     */
    public void create() throws Exception
    {
-      long start = System.currentTimeMillis();
-
-      pc = createPolicyConfiguration();
-
-      deploy();
-
-      initializePersistenceUnits();
-
-      log.debug("EJB3 deployment time took: " + (System.currentTimeMillis() - start));
+      try
+      {
+         long start = System.currentTimeMillis();
+   
+         pc = createPolicyConfiguration();
+   
+         deploy();
+   
+         initializePersistenceUnits();
+   
+         log.debug("EJB3 deployment time took: " + (System.currentTimeMillis() - start));
+      }
+      catch(Exception e)
+      {
+         try
+         {
+            destroy();
+         }
+         catch(Exception ignored)
+         {
+            // ignore
+         }
+         throw e;
+      }
    }
 
    public void start() throws Exception




More information about the jboss-cvs-commits mailing list