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

Need better logging on Java field type to SQL type mapping and exceptions

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 0.9.0, 0.9.6
    • Fix Version/s: None
    • Component/s: diagnostics, jdbc
    • Labels:
      None

      Description

      When a Java field and its corresponding SQL field are of incompatible types (as can happen with programming errors), OpenJPA presently just wraps the exception thrown by the JDBC driver. For example, if the type is declared as long in Java but boolean in PostgreSQL, a PostgreSQL error that the value "f" is not compatible with the type BigDecimal.

      The problem is that there's no indication of which mapped class is responsible for the exception, which can be a problem for a class with many relationships. Any of the related classes could have caused the problem.

      Better logging (probably at level TRACE) around calls to resultSet.getX would greatly help in debugging these problems. Just knowing the classname and the field name the JDBC get is being called for would be tremendously helpful.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              spatula Nick Johnson

              Dates

              • Created:
                Updated:

                Issue deployment