Summary: | Cannot override default schema for PostgreSQL | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [WebTools] Dali JPA Tools | Reporter: | Juergen Zimmermann <juergen.zimmermann> | ||||||||||||
Component: | General | Assignee: | Brian Vosburgh <brian.vosburgh> | ||||||||||||
Status: | RESOLVED FIXED | QA Contact: | |||||||||||||
Severity: | major | ||||||||||||||
Priority: | P1 | CC: | brian.vosburgh, david_williams, jkusnier, karenfbutzke, neil.hauge | ||||||||||||
Version: | 2.1.1 | Flags: | david_williams:
pmc_approved+
neil.hauge: pmc_approved? (raghunathan.srinivasan) neil.hauge: pmc_approved? (naci.dai) deboer: pmc_approved+ neil.hauge: pmc_approved? (neil.hauge) neil.hauge: pmc_approved? (kaloyan) neil.hauge: review+ |
||||||||||||
Target Milestone: | 2.2 RC3 | ||||||||||||||
Hardware: | PC | ||||||||||||||
OS: | Windows Vista | ||||||||||||||
Whiteboard: | PMC_approved | ||||||||||||||
Bug Depends on: | |||||||||||||||
Bug Blocks: | 276768 | ||||||||||||||
Attachments: |
|
Description
Juergen Zimmermann
2009-03-06 05:50:28 EST
Created attachment 127795 [details]
Screenshot for PostgreSQL when trying to override default schema
Do you see any exceptions in the error log that appear to be related? Created attachment 129817 [details]
Screenshot of Data Source Explorer
Sorry, there is no entry in .metadata/.log
Perhaps it might help to see the screenshot of the "Data Source Explorer" to see that there are 2 schemas: jpublic (being the default schema in PostgreSQL) and "hskaspring" (this is the schema I have to use).
I too am having this problem with Dali and PostgreSQL. Same issue, and no error in the log. Is a fix for this problem included in WTP 3.1 M7 ? We have added a Catalog Override in M7, which should allow you to set the appropriate catalog for your DB and then should allow you to pick a Schema Override. Give this a try and let me know of the outcome. I tried Eclipse 3.5RC1 and WTP 3.1M7: 1) Catalog: offers the existing database to be selected 2) Schema: is still empty when trying to override the default schema Upgrading severity based on comment #7. This bug prevents some users from using DB metadata in Dali, which limits at least 50% of our functionality. Created attachment 137063 [details]
candidate patch
This patch attempts to at least make the catalog and schema settings available and related to each other; but the desired behavior (esp. with the properties page) is not perfectly clear....
Created attachment 137153 [details]
reduced patch
Removed some unnecessary changes.
Current changes:
GenericJpaModel
- initialized JPA project config with user override catalog
JpaProjectPropertiesPage
- added connection between schema choices and selected catalog
- refactored catalog and schema code to reduce duplicate code
JpaFacetDataModelProvider
- added connection between schema choices and selected catalog
- cleaned up lots of sloppy code to make debugging easier
Created attachment 137200 [details]
amended patch
Amended patch to fix some of the flakiness that occurs when switching among different 'Connections' (e.g. if the 'Override default schema...' check box were checked when changing the 'Connection', the associated combo selection would be cleared; but there would be no error message indicating a schema needed to be selected).
(In reply to comment #11) > Amended patch to fix some of the flakiness that occurs when switching among > different 'Connections' (e.g. if the 'Override default schema...' check box > were checked when changing the 'Connection', the associated combo selection > would be cleared; but there would be no error message indicating a schema > needed to be selected). > What is the expected behavior as a result of this change? (In reply to comment #12) > (In reply to comment #11) > > > Amended patch to fix some of the flakiness that occurs when switching among > > different 'Connections' (e.g. if the 'Override default schema...' check box > > were checked when changing the 'Connection', the associated combo selection > > would be cleared; but there would be no error message indicating a schema > > needed to be selected). > > > > What is the expected behavior as a result of this change? > An error message saying something like "An override schema is not selected". I have tested with a derby database just to verify that existing use cases were not broken. This included testing the DDL generation, entity generation, connecting/disconnecting, deleting a connection, overriding the schema via the project properties as well as the new project wizard. There don't appear to be any regressions with this patch, things look good to me. * Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. This bug causes a major loss of functionality for users with certain configurations where the default table qualification cannot be calculated by Dali. This is a regression in functionality from Ganymede. It is currently known to affect users of the PostgreSQL and MS SQL Server DB's. This bug would also fix the issue in bug 276768. * Is there a work-around? If so, why do you believe the work-around is insufficient? There is no workaround for this problem. Dali DB related functionality will not work for these cases. * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? This fix has been thoroughly tested by Brian, Karen, and myself today to ensure that there are no regressions from current functionality. The new behavior to support this case has also be tested. * Give a brief technical overview. Who has reviewed this fix? See comment #10. This is a fairly extensive change, but it is isolated to 3 internal classes and 2 specific areas of functionality (new project creation and project properties), which in this case well isolates the fix, as well as the test cases needed to insure full test coverage. I have reviewed the code changes. * What is the risk associated with this fix? Risk is moderate, but well mitigated due to the amount of testing performed on this change. Due to the fact that the fix is isolated and the testing has been thorough, in addition to the severity of this bug, I think the change meets the criteria to be fixed in the next release candidate. I would like to get the change in at the beginning of this RC cycle so we can get the community testing early as well to insure that this problem has been corrected. Definitely a large patch for this point in the release, but code doesn't look like it will affect adopters, solves an ugly problem, and testing/regressions passed. Approved. Last patch checked into HEAD. I just tested WTP 3.1 RC3 using PostgreSQL 8.4.beta2, and it works fine. I am still seeing an issue with this if my database has a - (hyphen) in the name. When I rename the db and remove the - (hyphen) it works fine. Maybe an escaping issue when connecting to the db? (In reply to comment #19) > I am still seeing an issue with this if my database has a - (hyphen) in the > name. When I rename the db and remove the - (hyphen) it works fine. Maybe an > escaping issue when connecting to the db? > I could not replicate this problem. If I do the following: - build a PostgreSQL server with a database named "test-db" - build a DTP connection configured to use that database - start the New JPA Project wizard - select the DTP connection built above The "Catalog:" drop-down below the "Override default catalog from connection" check-box contains a delimited entry for the database: "test-db" Could you give a detailed description of the steps you took to see this problem? [continuing comment 20] ... and the "Schema:" drop-down below the "Override default schema from connection" check-box contains a list of database's schemata: information_schema pg_catalog pg_toast_temp_1 public My database name is all uppercase, not sure if that matters. TEST-DB (In reply to comment #22) > My database name is all uppercase, not sure if that matters. TEST-DB That changes things a bit. The dialog does not correctly detect an all-caps name as the default. (I will fix this.) But that does not prevent me from selecting the catalog with the same name and the schema drop-down from being populated with the list of schemata in that catalog/database. |