OpenJPA
  1. OpenJPA
  2. OPENJPA-2148

Issue with MaxColumnNameLength in the OracleDictionary class

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.1.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I am using oracle database with OpenJPA.

      The DBDictionary class defines default MaxColumnNameLength as 128.

      But In the OracleDictionary class which extend DBDictionary has MaxColumnNameLength as 30. While generating sql query, JPA takes first 28 characters of the column name and ignores rest of the characters. Also it takes start & end quotes, which in total makes it to 30 characters

      Due to this, jpa query fails if there are column in the oracle database with more than 28 characters as it finds mismatch in SQL query and actual column name.

      Please fix this issue by changing MaxColumnNameLength in OracleDictionary class to 128.

        Activity

        Hide
        Rick Curtis added a comment -

        What version of Oracle are you running? Has something changed on Oracle to allow column names with greater than 30 characters?

        Show
        Rick Curtis added a comment - What version of Oracle are you running? Has something changed on Oracle to allow column names with greater than 30 characters?
        Hide
        aabbcc added a comment -

        Its Oracle version 11. There are few column names with 30 characters in length. It seems OpenJPA considers start & end quotes as well while counting column name length therefore this issue is arising. Even I tried with different combination of characters.

        Its bug in OpenJPA.

        Show
        aabbcc added a comment - Its Oracle version 11. There are few column names with 30 characters in length. It seems OpenJPA considers start & end quotes as well while counting column name length therefore this issue is arising. Even I tried with different combination of characters. Its bug in OpenJPA.
        Hide
        Rick Curtis added a comment -

        > Please fix this issue by changing MaxColumnNameLength in OracleDictionary class to 128.
        I don't think changing MaxColumnNameLength to 128 is the correct solution. It sounds like 30 characters is the correct limit, but we need to fix our logic where we determine the actual length. Somehow we're getting message up when calculating length + delimiters.

        Show
        Rick Curtis added a comment - > Please fix this issue by changing MaxColumnNameLength in OracleDictionary class to 128. I don't think changing MaxColumnNameLength to 128 is the correct solution. It sounds like 30 characters is the correct limit, but we need to fix our logic where we determine the actual length. Somehow we're getting message up when calculating length + delimiters.
        Hide
        aabbcc added a comment -

        You need to set maxColumnNameLength limit to 32 in the OracleDictionary OR fix the OpenJPA code which determines actual length.

        Show
        aabbcc added a comment - You need to set maxColumnNameLength limit to 32 in the OracleDictionary OR fix the OpenJPA code which determines actual length.
        Hide
        Rick Curtis added a comment -

        I think setting maxColumnNameLength to 32 would be more of a band-aid than anything else. That being said, I'm pretty booked right now so I won't get to this one anytime soon here. Perhaps you, or someone else on the list has some time to dig into this problem and figure out where the real bug is.

        Show
        Rick Curtis added a comment - I think setting maxColumnNameLength to 32 would be more of a band-aid than anything else. That being said, I'm pretty booked right now so I won't get to this one anytime soon here. Perhaps you, or someone else on the list has some time to dig into this problem and figure out where the real bug is.
        Hide
        Rick Curtis added a comment -

        I'm closing this JIRA as I'm unable to reproduce the problem. Please reopen with a simple unit test if you're still having this problem.

        Show
        Rick Curtis added a comment - I'm closing this JIRA as I'm unable to reproduce the problem. Please reopen with a simple unit test if you're still having this problem.

          People

          • Assignee:
            Unassigned
            Reporter:
            aabbcc
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development