Author: michiel
Date: 2010-03-11 12:38:52 +0100 (Thu, 11 Mar 2010)
New Revision: 41334

Modified:
   
mmbase/trunk/applications/vpro-wizards/src/main/java/org/mmbase/applications/vprowizards/spring/WizardController.java
Log:
cancel transaction in case of exception

Modified: 
mmbase/trunk/applications/vpro-wizards/src/main/java/org/mmbase/applications/vprowizards/spring/WizardController.java
===================================================================
--- 
mmbase/trunk/applications/vpro-wizards/src/main/java/org/mmbase/applications/vprowizards/spring/WizardController.java
       2010-03-11 11:36:00 UTC (rev 41333)
+++ 
mmbase/trunk/applications/vpro-wizards/src/main/java/org/mmbase/applications/vprowizards/spring/WizardController.java
       2010-03-11 11:38:52 UTC (rev 41334)
@@ -64,20 +64,25 @@
 
         Command command = commandFactory.getNewInstance();
         Transaction transaction = cloudFactory.createTransaction(request);
+        ResultContainer resultContainer = new ResultContainer(request, 
response, transaction, locale);
+        try {
+            if(log.isDebugEnabled()){
+                log.debug("*********************************");
+                log.debug("Processing new request with transaction [" + 
transaction.getName() + "]");
+                log.debug("*********************************");
+            }
 
-        if(log.isDebugEnabled()){
-            log.debug("*********************************");
-            log.debug("Processing new request with transaction [" + 
transaction.getName() + "]");
-            log.debug("*********************************");
-        }
+            // do the data binding
+            ServletRequestDataBinder binder = new 
ServletRequestDataBinder(command);
+            binder.bind(request);
 
-        // do the data binding
-        ServletRequestDataBinder binder = new 
ServletRequestDataBinder(command);
-        binder.bind(request);
+            // process all the actions.
 
-        // process all the actions.
-        ResultContainer resultContainer = new ResultContainer(request, 
response, transaction, locale);
-        command.processActions(request, response, resultContainer);
+            command.processActions(request, response, resultContainer);
+        } catch (Exception e) {
+            transaction.cancel();
+            throw e;
+        }
 
         if (resultContainer.hasGlobalErrors() || 
resultContainer.hasFieldErrors()) {
             log.debug("Errors found, transaction not committed, but 
cancelled");
@@ -98,9 +103,10 @@
 
         }
 
-        // return the proper view.
+            // return the proper view.
         return viewResolver.getModelAndView(request, resultContainer);
 
+
     }
 
 

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to