Revision: 3451
Author: silva.josemanuel1
Date: Tue Apr 13 07:32:44 2010
Log: 1 - Fixed bug where the NetworkConflictResolver would not break out of the update loop when closed, since it was waiting for an update. There is now a check right after the update that will cause it to stop, and not apply the update.

2 - Made the PlayPen use the new copy constructor that does not copy column mappings, since it discarded them anyway. Fixed a bug that was a side effect of that process.

3 - Changed the import schema transaction back to before the dialog, so the UI does not block it and cause weird transactional states.
http://code.google.com/p/power-architect/source/detail?r=3451

Modified:
/trunk/src/main/java/ca/sqlpower/architect/enterprise/NetworkConflictResolver.java
 /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java
/trunk/src/main/java/ca/sqlpower/architect/swingui/olap/action/ImportSchemaAction.java

=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/enterprise/NetworkConflictResolver.java Wed Apr 7 13:00:40 2010 +++ /trunk/src/main/java/ca/sqlpower/architect/enterprise/NetworkConflictResolver.java Tue Apr 13 07:32:44 2010
@@ -268,6 +268,8 @@

// Request an update from the server using the current revision number.
                    JSONMessage message = getJsonArray(inboundHttpClient);
+ // The updater may have been interrupted/closed while waiting for an update.
+                   if (this.isInterrupted() || cancelled) break;
final JSONObject json = new JSONObject(message.getBody());
                    session.runInForeground(new Runnable() {
                        public void run() {
=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java Wed Apr 7 12:43:35 2010 +++ /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java Tue Apr 13 07:32:44 2010
@@ -134,7 +134,6 @@
 import ca.sqlpower.sqlobject.SQLRelationship;
 import ca.sqlpower.sqlobject.SQLSchema;
 import ca.sqlpower.sqlobject.SQLTable;
-import ca.sqlpower.sqlobject.SQLRelationship.ColumnMapping;
 import ca.sqlpower.sqlobject.SQLRelationship.SQLImportedKey;
 import ca.sqlpower.sqlobject.SQLTable.TransferStyles;
 import ca.sqlpower.sqlobject.undo.CompoundEventListener;
@@ -1349,15 +1348,8 @@
                        if (tablePane != null) {
                                logger.info("FOUND IT!"); //$NON-NLS-1$

-                               SQLRelationship newRel = new SQLRelationship(r);
-
-                               for (ColumnMapping child : 
newRel.getChildren(ColumnMapping.class)) {
-                                   try {
-                                       newRel.removeChild(child);
-                                   } catch (ObjectDependentException e) {
-                                       throw new RuntimeException(e);
-                                   }
-                               }
+                               SQLRelationship newRel = new SQLRelationship();
+                               newRel.updateToMatch(r, true);

                                SQLTable oldTable;

=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/olap/action/ImportSchemaAction.java Tue Apr 6 14:44:35 2010 +++ /trunk/src/main/java/ca/sqlpower/architect/swingui/olap/action/ImportSchemaAction.java Tue Apr 13 07:32:44 2010
@@ -113,19 +113,14 @@
                     final JFrame frame = editSession.getFrame();
frame.setLocationRelativeTo(session.getArchitectFrame());
                     frame.setVisible(true);
+
+                    session.getWorkspace().commit();

final SchemaEditPanel schemaEditPanel = new SchemaEditPanel(session, loadedSchema);

                     Callable<Boolean> okCall = new Callable<Boolean>() {
                         public Boolean call() throws Exception {
-                            try {
- boolean ok = schemaEditPanel.applyChanges();
-                                session.getWorkspace().commit();
-                                return ok;
-                            } catch (Throwable e) {
- session.getWorkspace().rollback("Error applying changes: " + e.toString());
-                                throw new RuntimeException(e);
-                            }
+                                return schemaEditPanel.applyChanges();
                         }
                     };

@@ -133,7 +128,6 @@
                         public Boolean call() throws Exception {
                             frame.dispose();
session.getOLAPRootObject().removeOLAPSession(osession); - session.getWorkspace().rollback("Schema importing cancelled");
                             return true;
                         }
                     };


--
To unsubscribe, reply using "remove me" as the subject.

Reply via email to