Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361021

Summary: The "Results" tab does not get displayed when more than one query is run against the DB2 Z V9 machine.
Product: [Tools] Data Tools Reporter: Rekha <nrekha>
Component: SQL Results ViewAssignee: dtp.sqldevtools-inbox <dtp.sqldevtools-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: bpayton
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch for defect 361021 none

Description Rekha CLA 2011-10-14 14:28:14 EDT
Build Identifier: 1.7.2.v20100914-1028

Description:-
Connect to a zServer
Select a table from the Tables folder and Right click Data - Return All Rows. 
The results appears on the right with the query in the Status tab and the row output in the Results tab. 
Now, select the same table and right click Data - Return all rows.
Again, the query appears in the Status tab and total rows in the Results tab.
Now, change the selection to the previous query that was run in the SQL Results tab. You will notice that the Status and the Results tab on the right are empty.

The reason is in the ResultHistorySection, in the selectinChangedListener, for the resultTable,when we navigate to another selection set the result and parameter list of the last display to be null. So, when we navigate to some other selection the result list is empty. The fix is to save the result and then set the result list to empty.


Patch:-

### Eclipse Workspace Patch 1.0
#P org.eclipse.datatools.sqltools.result.ui
Index: src/org/eclipse/datatools/sqltools/result/internal/ui/view/ResultHistorySection.java
===================================================================
RCS file: /cvsroot/datatools/org.eclipse.datatools.sqltools/plugins/org.eclipse.datatools.sqltools.result.ui/src/org/eclipse/datatools/sqltools/result/internal/ui/view/ResultHistorySection.java,v
retrieving revision 1.3
diff -u -r1.3 ResultHistorySection.java
--- src/org/eclipse/datatools/sqltools/result/internal/ui/view/ResultHistorySection.java	13 May 2010 19:46:08 -0000	1.3
+++ src/org/eclipse/datatools/sqltools/result/internal/ui/view/ResultHistorySection.java	14 Oct 2011 18:16:59 -0000
@@ -27,6 +27,7 @@
 import org.eclipse.datatools.sqltools.result.internal.ui.PreferenceConstants;
 import org.eclipse.datatools.sqltools.result.internal.ui.actions.ReExecuteAction;
 import org.eclipse.datatools.sqltools.result.internal.ui.utils.PreferenceUtil;
+import org.eclipse.datatools.sqltools.result.internal.utils.SerializationHelper;
 import org.eclipse.datatools.sqltools.result.model.IResultInstance;
 import org.eclipse.datatools.sqltools.result.ui.ResultsViewUIPlugin;
 import org.eclipse.datatools.sqltools.result.ui.view.ResultsViewControl;
@@ -447,9 +448,11 @@
                                 _detailParent.layout(true);
                                 _resultsViewControl.getResultSection().showDetail((IResultInstance) obj);
                                 
-                                // set the result and parameter list of the last display to be null for reclaiming them, when selection is changed.
+                             // set the result and parameter list of the last display to be null for reclaiming them, when selection is changed.
                                 if(lastResultInstance instanceof ResultInstance)
                                 {
+                                	Object[] objs ={lastResultInstance.getParameters(),((ResultInstance) lastResultInstance).getResults()};
+                                	SerializationHelper.SaveObjects(objs, ((ResultInstance) lastResultInstance).getFileName());
                                     ((ResultInstance) lastResultInstance).reclaimedTransientThings();
                                 }
                             }

                                }


Reproducible: Always
Comment 1 Rekha CLA 2011-11-02 16:32:43 EDT
Created attachment 206372 [details]
Patch for defect 361021

From CVS, Checked out 
plugin: org.eclipse.datatools.sqltools.result.ui 
Tag:- DTP_1_8_2_Release_201102060800 (Version) 

Changes made in the above version.

Thanks,
Rekha
Comment 2 Brian Payton CLA 2011-11-18 19:25:24 EST
Upon investigating, I found there is an alternate way to fix this problem in the IBM product code that does not require changes in DTP.  I am resolving this bug as WONT FIX.