Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2086

OracleDictionary setFixed and setFormOfUse(NCLOB) are not really doing what they should.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.1.1, 2.2.0
    • None
    • jdbc
    • Oracle 9g, 10g and 11g

    Description

      The setString() method in the OracleDictionary tries to be smart and and look up the column type, and detect and apply nchar and/or fixed char semantics.
      However, I believe that the type information is normally not present for queries, and the functions are never called.

      That means that characters outside the database character set will be lost during translation, and that comparison on CHAR (fixed length) columns will not match if
      the arguments are not padded to the column length.

      I suggest that the special nchar handling is removed as it is not working properly. The only "reliable" option is to set the connection property oracle.jdbc.defaultNChar=true,
      as it would be neigh impossible to get this right in an automatic way.
      (Actually, the sensible option is to convert the database to AL32UTF8, and not use nchars at all since Oracles nchar handling seems to be problematic. )

      Further as the fixedString handling also does not work without type information, the dictionary could either always, or depending on a flag,
      call the setFixedChar() method, or just rely on the connection parameter "fixedString" (and use setObject), avoiding the complexity (and the cost of reflection calls) altogether.

      Attachments

        Activity

          People

            Unassigned Unassigned
            pihlblad Karl PIhlblad
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: