DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Testcase Required Testcase Required
Assignee: Unassigned
Reporter: Ryan Asleson
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

SchemaTool: Does Not Honor "LowerCase"

Created: 09/Feb/12 05:56 AM   Updated: 21/Mar/12 10:19 AM   Resolved: 13/Feb/12 03:00 PM
Component/s: SchemaTool
Affects Version/s: 3.0.6
Fix Version/s: None

File Attachments: 1. Zip Archive (20 kB)
2. File schematool-1.1.0m4.sql (3 kB)
3. File schematool-3.0.6.sql (3 kB)
4. XML File schematool-ant.xml (2 kB)

Environment: PostgreSQL 8.4, Windows XP, DataNucleus 3.0.6

Datastore: PostgreSQL
Severity: Development

 Description  « Hide

I'm upgrading from DataNucleus 1.1.0m4 (yes, I know it is old) to the current 3.0.6 release.

I replaced the jar files and tweaked a few package names. Everything compiled and the bytecode enhancement didn't fail, so I thought it was going to be an easy upgrade.

However, when I tried to use SchemaTool to recreate the unit testing database, the insertion of sample data wasn't working. After much confusion, I noticed that two versions of each table existed: the previous ones created by 1.1.0m4 SchemaTool, which had lower case names (the PostgreSQL standard) and ones where the names were capitalized, which were created by 3.0.6 SchemaTool. When using SchemaTool, I set the "" property to LowerCase.

I tweaked SchemaTool to output the DDL. I noticed that the DDL produced by 1.1.0m4 put the table names in lower case, and without double quotes. This is the behavior I expected, considering I set the property. The DDL produced by 3.0.6 had the table names capitalized AND inside of double quotes, which explains why it created tables with capitalized names.

Attached to this issue is the DDL produced by 1.1.0m4, 3.0.6, and the XML fragment within my Ant file that uses SchemaTool.

It seems to me that 3.0.6 is not honoring the property the way it should. I tried using UpperCase and PreserveCase, and they both produced the same DDL with capitalized table names within quotes. I also tried using the datanucleus1 identifier factory, and it too produced DDL that was capitalized and within quotes.

I tried to debug the issue but didn't get very far. In the file around line 533 there is an array of properties specified via system properties, and I noticed that was not there, so I was hoping it was an oversight. However, I looked at the 1.1.0 version and it's not there either. I also looked through classes like MappedStoreManager, IdentifierFactory, and DN2IdentifierFactory. It looks like they are all trying to handle the case requested by the user.

My best very uneducated guess is that the "plumbing" is all there, but somewhere along the way the value of the property as set by the user is being dropped or lost, so the identifier factories use the default strategy.

Is this truly a bug or did I miss a change in the configuration? I can't see any changes in the SchemaTool documentation that's on the web.

Thank you!!!!!