Hi,
We faced weird problem: date/time related services in wM return time which is ahead of real time by approx 30 seconds. Environment where this issue is observed is as follows:
OS: HP UX
wM integration server: 7.1
jvm: java version “1.5.0.12” Java™ 2 Runtime Environment, Standard Edition (build 1.5.0.12-_21_mar_2008_11_52) Java HotSpot™ Server VM (build 1.5.0.12 jinteg:03.21.08-11:00 PA2.0 (aCC_AP), mixed mode)
To nail down the problem, the following steps were done (in the same sequence, as they are listed below)
1) Invoke wM service pub.getCurrentDate.
2) Invoke custom wm java service which has following code inside:
// pipeline
java.util.Date d = new java.util.Date(System.currentTimeMillis());
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(“yyyy-MM-dd HH:mm:ss.SSS”);
// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
IDataUtil.put( pipelineCursor, “dateTimeString”, sdf.format(d) );
pipelineCursor.destroy();
3) In unix console on the same server, run simple java class (using same JVM as wM does)
public class TestDate {
public static void main(String[] args) {
java.util.Date d = new java.util.Date(System.[I]currentTimeMillis/i);
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(“yyyy-MM-dd HH:mm:ss.SSS”);
System.out.println(sdf.format(d));
}
}
4) In unix console, execute date command
The following table shows results
Step
Time
1 (wM pub.getCurrentDate)
7/23/2009 15:02:04 EEST
2 (wM java service)
2009-07-23 15:02:04.457
3 (stand alone java application)
2009-07-23 15:01:27.445
4 (system time)
Thu Jul 23 15:01:28 EETDST 2009
Note, that step, which were executed last, display time which is earlier than time, returned by wM functions. It is also interesting, that java application itself reports correct time (same as system), but when exactly same code is executed as wM java service, it returns time in future. It is not clear whether mismatch is always same, but it looks to be somewhere in the region of 30 seconds
Has anyone observed this kind of trick and what could be the reason of that? (to solve it [temporarily ?] we have implemented own getTime service which queries db for sysdate
Cheers
Egidijus