Issue Details (XML | Word | Printable)

Key: NUCRDBMS-517
Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Testcase Required Testcase Required
Assignee: Unassigned
Reporter: Dietrich Fahrenholtz
Votes: 0
Watchers: 0
Operations

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

wrong creation of column identifier if length is greater than max length

Created: 08/Apr/11 05:02 PM   Updated: 09/May/11 09:59 AM   Resolved: 20/Apr/11 10:16 AM
Component/s: Schema
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. Text File truncate_fixed.txt (2 kB)

Environment: Windows XP Sp3, JSDK 1.6, Eclipse 3.6

Datastore: Oracle


 Description  « Hide
I created a Java object called "Partner. This object has a field with annotation
@Column(name = "\"PACKM_KZ_RUECKBEL_PARTNER_MO37\"", columnDefinition = "NUMBER(1) NULL")
However, the name of the column 1) has quotes and due to this is longer than 30 characters.
Current implementation of DataNucleus uses a function called "truncate" to shorten those column names that are too long.
When creating a native SQL statement for Oracle refuses to execute this statement returning an ORA error because 1) column name is too long and 2) close quote is missing.
I located the source of the error in the file 'org.datanucleus.store.mapped.identifier.AbstractIdentifierFactory.java" (3.0.0.m4) and remedied it. Have a look at the method ' truncate(String identifier, int lengthAllowed)'
Please see attachment below and put this amendment in your source code.

Best wishes,
Dietrich


Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 08/Apr/11 05:29 PM - edited
Thx, but "patch" (diff -u) is the recognised format for changes, showing inequivocably what you changed, so if you can provide any proposals in that format (e.g Eclipse option "Create Patch").

PS, putting quotes in the metadata name is typically not required, since the choice of identifier case implies what you need. This is the reason why we require a valid testcase that actually demonstrates what you're doing; so somebody could say ... "set persistence property XXX to YYY and it works fine" for example

Dietrich Fahrenholtz added a comment - 19/Apr/11 06:05 PM - edited
I'm sorry, but I cannot provide a patch since I did not check out the project from SVN.
The quotes, in fact, were inserted by our MDA tool, can't say why. Sometimes there are quotes around table column names sometimes not.

Andy Jefferson added a comment - 19/Apr/11 06:21 PM
So if you can't provide a patch then please provide a valid DN testcase as per
http://www.datanucleus.org/project/problem_reporting.html
and the JDO/JPA subpages. That then demonstrates something. I simply cannot change code without a valid reason that I can see.

Dietrich Fahrenholtz added a comment - 20/Apr/11 10:13 AM
We evaluated DN as a potential candidate to replace our current ORM, but since we couldn't see a major performance improvement we stopped evaluating.
I would like to provide a testcase, but I definitely have no time for this endeavour. Also we are not allowed to post snippets of our code, which would be part of the testcase. If you can't live with this, then I fear somebody else will report this error again later and you have to forget about this issue.