Gen Java CURRENT_TIMESTAMP function support of microsecond precision
search cancel

Gen Java CURRENT_TIMESTAMP function support of microsecond precision

book

Article ID: 27376

calendar_today

Updated On:

Products

Gen Gen - Workstation Toolset

Issue/Introduction

When using the Gen function CURRENT_TIMESTAMP in Java Web Generation clients, the final 3 digits are always zero i.e. only appear to get millisecond precision.

 

Environment

Gen Java applications.

Resolution

CURRENT_TIMESTAMP is working as designed for Gen Java applications per this explanation:

  • In general, Gen provides microsecond support (10-6 of a second) for the CURRENT_TIMESTAMP function. However, the situation is different with the Java implementation of the CURRENT_TIMESTAMP function (implemented as TIRDAT2).

  • For Java, TIRDAT2 only retrieves milliseconds (10-3 of a second), because it is implemented with a Calendar object. Therefore, for Java, any action diagram statement that sets an attribute view to CURRENT_TIMESTAMP will only get millisecond precision, regardless of the target RDBMS.

  • If a Java timestamp attribute view is assigned a value which has microseconds already populated, that precision will be maintained e.g. if a timestamp value with microsecond precision is read from a RDBMS and is assigned to a Java timestamp attribute view, then microseconds will be maintained in the view.