| Summary: | Problem with aliasing for the identifiers having more than 30 characters. | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | BalaKrishna P <balakrishna.mca> |
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P2 | CC: | christopher.delahunt, eclipselink.foundation-inbox, michael.f.obrien, mkienenb, neil.hauge |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
BalaKrishna P
Related to (or duplicate of) bug 262923, which is targeted for 1.1X. Aliased column names result in ORA-00972 https://bugs.eclipse.org/bugs/show_bug.cgi?id=262923 Mike K. thanks for linking these two. *** This bug has been marked as a duplicate of bug 262923 *** This is not quite a duplicate of bug 262923 because it is a different situation. Bug 262923 deals with EclipseLink generating Database column names from attribute names based on the JPA specification and hitting the 30character Oracle limit. This bug is dealing with already defined database column names that are at the limit or near it (ie 29 characters). With such a column name, using the RownumFiltering option will cause EclipseLink to generate aliases for the column - this currently is a concatenation of the column name and an index, increasing the length of the alias beyond the limit. Chris, I don't know about the "@SequenceGenerator" part of the comments described by Michael OBrien, but the initial description for 262923 as well as the behavior I'm seeing (after upgrading from TopLink Essentials) is identical to what you just described. I have a table with a predefined 30-character field, and when I do a query.getResultList(), it generates field + 2-digit index. I suspect Michael is saying the same thing that you are, only he's pointing out that the example code has to unnecessarily restrict the length of names so that they don't trigger this bug when the identifier exceeds 30 characters in Oracle. But I'll let him comment on that. This bug will only reproduce if you have set the max results or first rows that should be returned for a query. When these are set, EclipseLink (depending on platform support) will attempt to use rownum filtering, and wrap the initial generated SQL with database specific code. To get around the fact that some columns may be in the initial SQL twice and the problem databases (Oracle) have with dealing with columns using the same name in the wrapped SQL, unique aliases needed to be used - hence the concatination of an index. If you hit this problem and must use max/first rows on queries, you can workaround the issue by calling setShouldUseRownumFiltering(false) on the DatabasePlatform. This will prevent EclipseLink from using the platform's rownum filtering support, so it does not need to add the index to generate unique aliases. bug 262923 deals with EclipseLink generating column names, and so should be dealt with independently from this one. In this bug, the column names are correct (potentially anyway, they are user defined) and cannot be changed. It is the choice of aliases that hits the limit. This bug is being moved to Future where we can properly sort them all together based on community votes and severity. We will then assign them accordingly to future patch sets and releases. Changing the priority of the bugs that have been recently triaged to future. Targetting them to P2 will differentiate them from the P3s that have been triaged into future earlier. Fixed through the fix for bug 261076 https://bugs.eclipse.org/bugs/show_bug.cgi?id=261076 switching aliases to use a1, a2, etc. The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |