Troubleshooting
Problem
Cause
Diagnosing The Problem
2014-02-26 13:31:29,979:SQLDEBUG:Thread-13_MyServer_0: Executing sql [PREPARED STATEMENT - INSERT /*YANTRA*/ INTO YFS_TASK_Q(TASK_Q_KEY,TRANSACTION_KEY,DATA_KEY,DATA_TYPE,AVAILABLE_DATE,HOLD_FLAG,LOCKID,CREATETS,MODIFYTS,CREATEUSERID,MODIFYUSERID,CREATEPROGID,MODIFYPROGID) values ( '20140226133417401775215','SCHEDULE.0001','20140226133416401775167','OrderHeaderKey','2014-02-26T13:34:16','N',0,'2014-02-26T13:34:16','2014-02-26T13:34:16','MyServer','MyServer','MyServer','MyServer' ) : YFCEntityDBHome Note that the time of the log statement is 2014-02-26 13:31:29,979, but CREATETS and MODIFYTS are both calculated as 2014-02-26T13:34:16. There is a difference of nearly 3 minutes, although both application server and database are in the same timezone.
Resolving The Problem
Oracle: "SELECT /* YANTRA */ SYSDATE FROM DUAL"
DB2: "select CURRENT TIMESTAMP from SYSIBM.SYSDUMMY1"
Then the current time of the application is obtained using System.currentTimeMillis(). The difference is calculated as applicationTime-dbTime. YCPConnholder will print the difference in milliseconds if VERBOSE trace is enabled:
2014-02-26 13:31:30,169:VERBOSE:Thread-13_MyServer_0: DBDiff -166272 [system] : YCPConnHolder
In this example, DBDiff -166272 means that the database is nearly 3 minutes ahead of time (166272 ms / 1000 / 60 = 2,7 min). This difference is then used to calculate CREATETS / MODIFYTS as System.currentTimeMillis()-dbdiff. Whereas, log4j only uses the current timestamp of the application to print the log statement.
It should be taken care of the times that are set at the Operating System level of both the servers. They should be adjusted to be in sync to avoid this kind of confusion.
Was this topic helpful?
Document Information
Modified date:
30 June 2025
UID
swg21671327