Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.6
    • Labels:
      None

      Description

      We are calling an SP to retrieve a timestamp from the DB but the mapping of the nano seconds is not being done correctly. Only milliseconds are being returned although the SP is returning the nano seconds.
      After debugging through the apache db utils, we found that in the class BeanProcessor (method callSetter), the setting of timestamp is not being done properly:

      if ("java.sql.Timestamp".equals(targetType)) {
           value = new java.sql.Timestamp(((java.util.Date) value).getTime());
       }
      

      We have modified the codes as follows so as to get the nano seconds:

      if ("java.sql.Timestamp".equals(targetType))
      {
       int nanos = ((Timestamp) value).getNanos(); 
      value = new java.sql.Timestamp(((Timestamp) value).getTime());
       ((Timestamp) value).setNanos(nanos); 
      } 
      

      Can you please provide a fix as soon as possible. (v1.6 would be great)

        Activity

        Feysal Rujbally created issue -
        Daniele Cremonini made changes -
        Field Original Value New Value
        Attachment vcs-diff8964305076305734485.patch [ 12645631 ]
        Hide
        Daniele Cremonini added a comment -

        Plese find attached patch. Tests were modified to check the suggested implementation.

        Show
        Daniele Cremonini added a comment - Plese find attached patch. Tests were modified to check the suggested implementation.
        Hide
        Feysal Rujbally added a comment -

        Can you please advise when a new version will be available.

        Show
        Feysal Rujbally added a comment - Can you please advise when a new version will be available.
        Benedikt Ritter made changes -
        Description We are calling an SP to retrieve a timestamp from the DB but the mapping of the nano seconds is not being done correctly. Only milliseconds are being returned although the SP is returning the nano seconds.
        After debugging through the apache db utils, we found that in the class BeanProcessor (method callSetter), the setting of timestamp is not being done properly:

        if ("java.sql.Timestamp".equals(targetType)) {
             value = new java.sql.Timestamp(((java.util.Date) value).getTime());
         }

        We have modified the codes as follows so as to get the nano seconds:

        if ("java.sql.Timestamp".equals(targetType))
        {
         int nanos = ((Timestamp) value).getNanos();
        value = new java.sql.Timestamp(((Timestamp) value).getTime());
         ((Timestamp) value).setNanos(nanos);
        }

        Can you please provide a fix as soon as possible. (v1.6 would be great)
        We are calling an SP to retrieve a timestamp from the DB but the mapping of the nano seconds is not being done correctly. Only milliseconds are being returned although the SP is returning the nano seconds.
        After debugging through the apache db utils, we found that in the class BeanProcessor (method callSetter), the setting of timestamp is not being done properly:

        {code:java}
        if ("java.sql.Timestamp".equals(targetType)) {
             value = new java.sql.Timestamp(((java.util.Date) value).getTime());
         }
        {code}

        We have modified the codes as follows so as to get the nano seconds:

        {code:java}
        if ("java.sql.Timestamp".equals(targetType))
        {
         int nanos = ((Timestamp) value).getNanos();
        value = new java.sql.Timestamp(((Timestamp) value).getTime());
         ((Timestamp) value).setNanos(nanos);
        }
        {code}

        Can you please provide a fix as soon as possible. (v1.6 would be great)
        Hide
        Benedikt Ritter added a comment -

        Feysal Rujbally I'm currently working on the open issues and expect to cut Dbutil 1.6 RC1 anytime this week.

        Show
        Benedikt Ritter added a comment - Feysal Rujbally I'm currently working on the open issues and expect to cut Dbutil 1.6 RC1 anytime this week.
        Benedikt Ritter made changes -
        Fix Version/s 1.6 [ 12322483 ]
        Benedikt Ritter made changes -
        Priority Blocker [ 1 ] Major [ 3 ]
        Benedikt Ritter made changes -
        Assignee Benedikt Ritter [ britter ]
        Hide
        Benedikt Ritter added a comment -

        Fixed in rev. 16110066. Thanks for contributing!

        Show
        Benedikt Ritter added a comment - Fixed in rev. 16110066. Thanks for contributing!
        Benedikt Ritter made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Benedikt Ritter made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        198d 6h 56m 1 Benedikt Ritter 16/Jul/14 16:08
        Resolved Resolved Closed Closed
        3d 16h 39m 1 Benedikt Ritter 20/Jul/14 08:48

          People

          • Assignee:
            Benedikt Ritter
            Reporter:
            Feysal Rujbally
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development