Uploaded image for project: 'Hibernate ORM'
  1. HHH-10249

Oracle 12 driver breaks TemporalType.DATE behaviour

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.0.3
    • Fix Version/s: None
    • Component/s: hibernate-core
    • Environment:
      Oracle 12c Database
      ojdbc6 / ojdbc7 12.1.0.1.0
      hibernate 4.2.19.Final-redhat-2 / hibernate 5.0.3.Final
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Suitable for new contributors:
      Yes, likely
    • Requires Release Note:
      Affirmative
    • Last commented by a user?:
      true
    • Sprint:

      Description

      As described here

      http://stackoverflow.com/questions/33232260/temporaltemporaltype-date-with-oracle-12

      Oracle changed its handling of Date again with the 12.x drivers. The code

      OracleDataSource ods = new OracleDataSource();
      ...
      Connection conn = ods.getConnection();
      PreparedStatement ps = conn.prepareStatement("UPDATE MyEntity SET importantDate = ? WHERE myentityId = 4385");
      ps.setDate(1, new java.sql.Date(new java.util.Date().getTime()));
      ps.execute();
      

      sets importantDate to a date with 00:00:00 when using 11.x - drivers, but 12.x saves the current time as well. As a result, date fields in entities annotated @Temporal(TemporalType.DATE) don't cut off the time part anymore.

      Oracle12cDialect should provide a workaround to restore the intended behaviour.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated: