This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 227588 - Cleanup db.dataview and implement multiple resultsets
Summary: Cleanup db.dataview and implement multiple resultsets
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords: NETFIX, PATCH_AVAILABLE
Depends on:
Blocks: 73341 205307
  Show dependency tree
 
Reported: 2013-03-17 22:47 UTC by matthias42
Modified: 2013-03-25 09:33 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Result of test for scrollable resultsets (1.97 KB, text/plain)
2013-03-17 22:47 UTC, matthias42
Details
Make SQLStatementExecutorTest work reliable (AXION held internal views open, that prevented simpletable from drop) (672 bytes, patch)
2013-03-17 22:49 UTC, matthias42
Details | Diff
02 Preclean Celleditors (8.29 KB, patch)
2013-03-17 22:50 UTC, matthias42
Details | Diff
03 Cleanup TableModels (88.98 KB, patch)
2013-03-17 22:50 UTC, matthias42
Details | Diff
04 NumberFieldEditor should return Numbers,not strings (4.25 KB, patch)
2013-03-17 22:50 UTC, matthias42
Details | Diff
05 Fix JXTableRowHeader to react to changes in the table model (5.55 KB, patch)
2013-03-17 22:51 UTC, matthias42
Details | Diff
06 Enable display of LOB values in read-only tables (14.36 KB, patch)
2013-03-17 22:52 UTC, matthias42
Details | Diff
07 Use scrollable resultset for efficient queries (replaces SQL mangeling) (17.18 KB, patch)
2013-03-17 22:53 UTC, matthias42
Details | Diff
08 Move paging handling (display part) completly into DataViewPageContext (11.60 KB, patch)
2013-03-17 22:53 UTC, matthias42
Details | Diff
09 Fix display of "page" and total row count for the "unknown row count case" (4.32 KB, patch)
2013-03-17 22:54 UTC, matthias42
Details | Diff
10 Fix spelling of DataViewDBTable#getTable and DataViewDBTable#getTableCount (5.77 KB, patch)
2013-03-17 22:54 UTC, matthias42
Details | Diff
11 Make SQLStatementGenerator independent of DataVIew (26.89 KB, patch)
2013-03-17 22:54 UTC, matthias42
Details | Diff
12 Move tblMetaData into DavaViewPageContext (31.49 KB, patch)
2013-03-17 22:55 UTC, matthias42
Details | Diff
13 Move editable handling completly into the DataViewTableUIModel (3.80 KB, patch)
2013-03-17 22:55 UTC, matthias42
Details | Diff
14 Correct handling of composite primary keys (18.88 KB, patch)
2013-03-17 22:56 UTC, matthias42
Details | Diff
15 Handle multiple resultsets from sql (44.10 KB, patch)
2013-03-17 22:56 UTC, matthias42
Details | Diff
Exception in DataViewTableUI#getCellRenderer (4.84 KB, text/plain)
2013-03-19 11:01 UTC, Jaroslav Havlin
Details
16 Improve handling of EDT in dataview (42.31 KB, patch)
2013-03-24 16:15 UTC, matthias42
Details | Diff
17 Fix changing width row header (2.25 KB, patch)
2013-03-24 16:17 UTC, matthias42
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description matthias42 2013-03-17 22:47:46 UTC
Created attachment 132720 [details]
Result of test for scrollable resultsets

Attached you find a patch series, that

a) cleans up the table models/handling in the db.dataview module
b) make LOB fields accessible when the view is not editable (ex. in joins)
c) switch to use scrollable resultsets if available (simlifies the SQL handling)
d) fix bug in primary key handling (a partial composite key was acceptet as a valid identifier for a table)
e) implements display of multiple resultsets (bug 73341)
f) simplifies the JXTableRowHeadder (bug 205307)

I'll also attach a protocol of my quick check of scrollable resultset support. I had only one fail, so I'm pretty confident, that the JDBC drivers matured enougth to use this feature.
Comment 1 matthias42 2013-03-17 22:49:41 UTC
Created attachment 132721 [details]
Make SQLStatementExecutorTest work reliable (AXION held internal views open, that prevented simpletable from drop)
Comment 2 matthias42 2013-03-17 22:50:05 UTC
Created attachment 132722 [details]
02 Preclean Celleditors
Comment 3 matthias42 2013-03-17 22:50:37 UTC
Created attachment 132723 [details]
03 Cleanup TableModels
Comment 4 matthias42 2013-03-17 22:50:58 UTC
Created attachment 132724 [details]
04 NumberFieldEditor should return Numbers,not strings
Comment 5 matthias42 2013-03-17 22:51:26 UTC
Created attachment 132725 [details]
05 Fix JXTableRowHeader to react to changes in the table model
Comment 6 matthias42 2013-03-17 22:52:46 UTC
Created attachment 132726 [details]
06 Enable display of LOB values in read-only tables
Comment 7 matthias42 2013-03-17 22:53:05 UTC
Created attachment 132727 [details]
07 Use scrollable resultset for efficient queries (replaces SQL mangeling)
Comment 8 matthias42 2013-03-17 22:53:26 UTC
Created attachment 132728 [details]
08 Move paging handling (display part) completly into DataViewPageContext
Comment 9 matthias42 2013-03-17 22:54:03 UTC
Created attachment 132729 [details]
09 Fix display of "page" and total row count for the "unknown row count case"
Comment 10 matthias42 2013-03-17 22:54:35 UTC
Created attachment 132730 [details]
10 Fix spelling of DataViewDBTable#getTable and DataViewDBTable#getTableCount
Comment 11 matthias42 2013-03-17 22:54:55 UTC
Created attachment 132731 [details]
11 Make SQLStatementGenerator independent of DataVIew
Comment 12 matthias42 2013-03-17 22:55:12 UTC
Created attachment 132732 [details]
12 Move tblMetaData into DavaViewPageContext
Comment 13 matthias42 2013-03-17 22:55:48 UTC
Created attachment 132733 [details]
13 Move editable handling completly into the DataViewTableUIModel
Comment 14 matthias42 2013-03-17 22:56:10 UTC
Created attachment 132734 [details]
14 Correct handling of composite primary keys
Comment 15 matthias42 2013-03-17 22:56:28 UTC
Created attachment 132735 [details]
15 Handle multiple resultsets from sql
Comment 16 Jaroslav Havlin 2013-03-19 07:05:03 UTC
Wow, great job! Thank you very much, Matthias.

I've applied the patches locally and I'm testing them now.
If everything goes well, I'll push the changes to repository in a few hours.
Comment 17 Jaroslav Havlin 2013-03-19 10:51:20 UTC
Applied as core-main #8d338de53196, #ddb67b8a29de, #345ea2a50dd6, #ef61f0ef8dce, #eea56a79fe8c, #2544049e1c63, #877efcefc70d, #703dcdbf7e71, #db24ed0f1dd8, #c624d0b53da5, #7116387436bf, #36bcd5a21e11, #dbc6ebe16347, #7357da8c17bf, #5c6fcd257573
Comment 18 Jaroslav Havlin 2013-03-19 11:01:50 UTC
Created attachment 132790 [details]
Exception in DataViewTableUI#getCellRenderer

Exception encountered while setting page size or moving to next/previous page.

I've discovered two small issues:

DataViewTableUI#getCellRenderer should not probably throw any exception when the cell is not in the model.
The "Previous page" button was enabled if the first page was shown.

Fixed in http://hg.netbeans.org/core-main/rev/7fbd44e93df0
Please check it.

Thank you for all the patches, Matthias!
Comment 19 matthias42 2013-03-19 20:41:40 UTC
I think I know the reason for the exception. There are changes done to the DataViewTableUIModel off the EDT - this just cries for problems.

I'll look into it in the next days, but I'm not sure when to get to it. This needs some serious reworks in SQLExcecutionHelper, as calls are wildly scattered.

Most probably wrapping the finally part in SQLExcecutionHelper#loadDataFrom into Mutex.Event#writeAccess would already go a long way (the most brutal update is moved into the EDT by this).

Thanks for the very fast reaction Jaroslav!
Comment 20 Quality Engineering 2013-03-20 02:07:32 UTC
Integrated into 'main-golden', will be available in build *201303192300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/8d338de53196
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #227588: Make SQLStatementExecutorTest work reliable (AXION held internal views open, that prevented simpletable from drop)
Patch from Matthias42
Comment 21 matthias42 2013-03-24 16:15:34 UTC
Created attachment 132995 [details]
16 Improve handling of EDT in dataview

The attached patch should improve the situation. The critical sections are guarded by Mutex.Event#writeAccess - forcing updates into the EDT should eliminate problems while rendering (your exception report).

Please give it a spin.

I'll attach another patch - the row header size changed while edditing the content - the attached patch fixes this by forcing a reasonable size (fitting five digits).
Comment 22 matthias42 2013-03-24 16:17:01 UTC
Created attachment 132996 [details]
17 Fix changing width row header
Comment 23 Jaroslav Havlin 2013-03-25 09:33:23 UTC
(In reply to comment #21)
> Created attachment 132995 [details]
> 16 Improve handling of EDT in dataview
Thank you very much for another huge patch!
Integrated as http://hg.netbeans.org/core-main/rev/9711f16a0085

> I'll attach another patch - the row header size changed while edditing the
> content - the attached patch fixes this by forcing a reasonable size (fitting
> five digits).
Integrated as http://hg.netbeans.org/core-main/rev/4e4efc1ec6af
Thanks again.