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 197105 - The schema-property should be editable in unconnected state
Summary: The schema-property should be editable in unconnected state
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: DB schema (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jiri Rechtacek
URL:
Keywords: NETFIX
: 150215 163073 191359 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-03-25 20:43 UTC by matthias42
Modified: 2012-07-10 17:51 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed patch (see comment) (1.34 KB, patch)
2011-03-25 20:43 UTC, matthias42
Details | Diff
Schema Highlighting before change (84.13 KB, image/jpeg)
2011-05-11 20:01 UTC, matthias42
Details
Schema Highlighting after change (83.85 KB, image/jpeg)
2011-05-11 20:02 UTC, matthias42
Details
Updated patch (4.84 KB, patch)
2011-05-18 19:32 UTC, matthias42
Details | Diff
Patch Version 3 (8.07 KB, patch)
2011-05-28 21:12 UTC, matthias42
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description matthias42 2011-03-25 20:43:05 UTC
Created attachment 107291 [details]
Proposed patch (see comment)

Hey,

the schema property of the connection node in the database-explorer should be editable. A college of mine noticed this today and got a bit annoyed by it. So I had a look at it this evenning and the fix seems so easy (see patch). It applies the same principle that is used for the other connection properties also to the schema.

Would be nice if this could be applied for netbeans 7.

Greetings

Matthias
Comment 1 Jiri Rechtacek 2011-03-30 13:26:20 UTC
> Proposed patch (see comment)
Thanks for your patch again.
> Would be nice if this could be applied for netbeans 7.
It couldn't. 7.0 has been in high resistance mode, only FCS stoppers can be fixed - http://wiki.netbeans.org/NB70HighResistance
Comment 2 Jiri Rechtacek 2011-05-06 12:19:31 UTC
Matthias, the patch doesn't work correctly. Connection's Display Name nor default schema (visualized by bold font) doesn't reflect this change. Needed to propagate this change to other features. Nice to have a property customizer for choosing from existing schemas only.
Comment 3 matthias42 2011-05-11 20:01:55 UTC
Created attachment 108236 [details]
Schema Highlighting before change
Comment 4 matthias42 2011-05-11 20:02:26 UTC
Created attachment 108237 [details]
Schema Highlighting after change
Comment 5 matthias42 2011-05-11 20:08:55 UTC
(In reply to comment #2)
> Matthias, the patch doesn't work correctly. Connection's Display Name nor
> default schema (visualized by bold font) doesn't reflect this change.

To the highlighting please see screenshots - this works as expected. But then I just realise, that there is some strange interaction going on.

There are somethinks in this module seem strange - for the record: A change in the jdbc URL is also not reflected in the node. But this is wrong, but I headed in the wrong directions in the inner workings of this module. I have to take a closer look.
Comment 6 Jiri Rechtacek 2011-05-12 08:51:45 UTC
I observed the wrong behavior with Java DB - default connection to APP schema. After change to SYS schema, no change in schema highlighting.
Comment 7 matthias42 2011-05-18 19:32:45 UTC
Created attachment 108380 [details]
Updated patch

The updated patch adjusts the connection node so that changes in the username, database and schema are correctly reflected (these 3 properties indirectly influence name und displayname of the node/connection).

The displayname and name is only set, if the new name is not the same as the old or the autogenerated one.
Comment 8 Jiri Rechtacek 2011-05-27 11:02:41 UTC
Thanks, the patch2 makes it better, but I still see a problem while editing SQL commands in editor. At least, Code Completion doesn't change the default tables (tables don't requiring schema prefix) if the schema has been changed. IMHO it's not ready for apply now.
Comment 9 matthias42 2011-05-28 21:12:26 UTC
Created attachment 108572 [details]
Patch Version 3

Ok - if I continue this I will have touched each part of the database explorer api ;-)

The problem lied in the fact that the Metadata for a database connection (handled in MetadataModelManager) was cached and as the key was the connection itself the meta was not rebuild when the connection changed. In the connection node is a function that updated the internal metadata of the connection and now also updates the MetadataModelManager.

Additionally this fixes the case where the default schema was changed via the explorer view and the syntax completion did not follow this change.
Comment 10 matthias42 2011-07-10 16:29:21 UTC
Could you please give it another spin?
Comment 11 matthias42 2011-10-12 19:22:01 UTC
Hey, this is targeted for 7.1 - will it make it in? What holds it back? What can I do?
Comment 12 Jiri Rechtacek 2011-10-19 11:30:11 UTC
Thanks, this patch should work properly. Integrated in core-main/rev/9d6a9e2e7ec1
Comment 13 Quality Engineering 2011-10-20 14:30:46 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/9d6a9e2e7ec1
User: Jiri Rechtacek <jrechtacek@netbeans.org>
Log: #197105: The schema-property should be editable in unconnected state;
applied matthias42's patch, thanks
Comment 14 matthias42 2011-10-27 21:22:01 UTC
*** Bug 150215 has been marked as a duplicate of this bug. ***
Comment 15 matthias42 2012-03-10 22:22:34 UTC
*** Bug 191359 has been marked as a duplicate of this bug. ***
Comment 16 matthias42 2012-07-10 17:51:03 UTC
*** Bug 163073 has been marked as a duplicate of this bug. ***