Revision: 3364
Author: [email protected]
Date: Fri Mar  5 15:12:02 2010
Log: Fixed a transaction that needed to roll back on exceptions.
http://code.google.com/p/power-architect/source/detail?r=3364

Modified:
 /trunk/src/ca/sqlpower/architect/swingui/RelationshipEditPanel.java

=======================================
--- /trunk/src/ca/sqlpower/architect/swingui/RelationshipEditPanel.java Fri Feb 5 12:17:09 2010 +++ /trunk/src/ca/sqlpower/architect/swingui/RelationshipEditPanel.java Fri Mar 5 15:12:02 2010
@@ -319,8 +319,8 @@

        public boolean applyChanges() {
            SQLPowerUtils.unlistenToHierarchy(session.getRootObject(), this);
- relationship.begin(Messages.getString("RelationshipEditPanel.modifyRelationshipProperties")); //$NON-NLS-1$
                try {
+ relationship.begin(Messages.getString("RelationshipEditPanel.modifyRelationshipProperties")); //$NON-NLS-1$
                        relationship.setName(relationshipName.getText());
                        
relationship.setPhysicalName(relationshipName.getText());
                        // set the parent label text of relationship lines
@@ -388,8 +388,10 @@
                 relationship.setDeleteRule(UpdateDeleteRule.SET_NULL);
             }

-               } finally {
-                       relationship.commit();
+            relationship.commit();
+               } catch (Exception e) {
+                   relationship.rollback(e.getMessage());
+                   throw new RuntimeException(e);
                }
                return true;
        }

Reply via email to