Author: adrianc
Date: Mon Nov  3 15:32:11 2014
New Revision: 1636374

URL: http://svn.apache.org/r1636374
Log:
Cleaned up ModelScreen.java transaction handling - 
https://issues.apache.org/jira/browse/OFBIZ-4278.

Modified:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreen.java

Modified: 
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreen.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreen.java?rev=1636374&r1=1636373&r2=1636374&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreen.java 
(original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreen.java 
Mon Nov  3 15:32:11 2014
@@ -162,19 +162,7 @@ public class ModelScreen extends ModelWi
 
             // render the screen, starting with the top-level section
             this.section.renderWidgetString(writer, context, 
screenStringRenderer);
-        } catch (ScreenRenderException e) {
-            throw e;
-        } catch (RuntimeException e) {
-            String errMsg = "Error rendering screen [" + this.sourceLocation + 
"#" + getName() + "]: " + e.toString();
-            Debug.logError(errMsg + ". Rolling back transaction.", module);
-            try {
-                // only rollback the transaction if we started one...
-                TransactionUtil.rollback(beganTransaction, errMsg, e);
-            } catch (GenericEntityException e2) {
-                Debug.logError(e2, "Could not rollback transaction: " + 
e2.toString(), module);
-            }
-            // after rolling back, rethrow the exception
-            throw new ScreenRenderException(errMsg, e);
+            TransactionUtil.commit(beganTransaction);
         } catch (Exception e) {
             String errMsg = "Error rendering screen [" + this.sourceLocation + 
"#" + getName() + "]: " + e.toString();
             Debug.logError(errMsg + ". Rolling back transaction.", module);
@@ -189,13 +177,6 @@ public class ModelScreen extends ModelWi
 
             // after rolling back, rethrow the exception
             throw new ScreenRenderException(errMsg, e);
-        } finally {
-            // only commit the transaction if we started one... this will 
throw an exception if it fails
-            try {
-                TransactionUtil.commit(beganTransaction);
-            } catch (GenericEntityException e2) {
-                Debug.logError(e2, "Could not commit transaction: " + 
e2.toString(), module);
-            }
         }
     }
 


Reply via email to