All storage managers, if you alter a tablespace the refresh of the tree is incorrect as pointed out by Fung
The root cause of the problem is that we don't use jide's TreeTable correctly. We seem to fire table model events (see for example Db2StorageManagerPanel.refreshCreateTablespace() - there is explicit fireTableRowsInserted()). I think this is incorrect: instead, we should be using TreeTableModel's addRow(), deleteRow(), expandRow() etc. which fires appropriate events.
the fix also includes initial sorting of the items in the tree table via sort().
the fix also includes initial sorting of the items in the tree table via sort().
Fung,
since you are working on the storage managers for other databases, here is the explanation of the fix (I am referring to Db2StorageManagerPanel line numbers):
1. changed to root.getChildren().add() instead of root.add() - lines 454, 596
I've also added initial sorting - created sort() method, see all the places where it is getting called. I also removed some dead and unnecessary code.
Hope this helps.
Fung,
since you are working on the storage managers for other databases, here is the explanation of the fix (I am referring to Db2StorageManagerPanel line numbers):
1. changed to root.getChildren().add() instead of root.add() - lines 454, 596
I've also added initial sorting - created sort() method, see all the places where it is getting called. I also removed some dead and unnecessary code.
Hope this helps.
Niels Gron: assign it to Fund and add a comment for him to code review and apply to PostgreSQL
Niels Gron: assign it to Fund and add a comment for him to code review and apply to PostgreSQL
Made the following changes for all storage managers (DB2, Informix place holder, MySQL, Oracle, PostgreSQL, SQL Server and Sybase ASE):
. ensure tree view is refreshed correctly after a new node is added, or an existing node is modified,
. ensure tablespaces and databases are ordered the same way in tree view, table view and combo box list.
. ensure retrieval of combo box selection in application threads goes through Swing EDT.
Changes are checked in as revision 10379 of ADS 8.0 branch.
Made the following changes for all storage managers (DB2, Informix place holder, MySQL, Oracle, PostgreSQL, SQL Server and Sybase ASE):
. ensure tree view is refreshed correctly after a new node is added, or an existing node is modified,
. ensure tablespaces and databases are ordered the same way in tree view, table view and combo box list.
. ensure retrieval of combo box selection in application threads goes through Swing EDT.
Changes are checked in as revision 10379 of ADS 8.0 branch.
Issue #3135 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
No fixed build |
No time estimate |
The root cause of the problem is that we don't use jide's TreeTable correctly. We seem to fire table model events (see for example Db2StorageManagerPanel.refreshCreateTablespace() - there is explicit fireTableRowsInserted()). I think this is incorrect: instead, we should be using TreeTableModel's addRow(), deleteRow(), expandRow() etc. which fires appropriate events.