a***@gmail.com
2007-08-28 05:39:07 UTC
We have an application that extensively makes use of the java.util.Date objects for doing comparison of events etc. To have uniformity in the Time Zone of all the Date objects in the application, the startup module of the application sets up the Time Zone of the host JVM to GMT, using java.util.TimeZone.setDefault(java.util.TimeZone.getTimeZone("GMT")). The Time Zone for the host machine/OS can be different from GMT. Also, this is the only place in the application code where the Time Zone for the host JVM is set. Ideally, after this step, any new java.util.Date object created in the application should have its TimeZone set to GMT. Application code assumes this fact, and does not check for the TimeZone for each new Date object created in the system.
The application has been running without any problem on Websphere Application Server 6.0.2.13 for over a year now. Recently, we have migrated to WAS 6.1.0.9 (without any changes to the code that uses Dates and TimeZones). We have observed some issues in WAS 6.1 w.r.t the treatment of java.util.TimeZone. The application still sets up the TimeZone to GMT at the time of startup, but when WAS 6.1 processes requests submitted on JSPs, it seems to be changing the TimeZone of the host JVM to the locale TimeZone (set for the OS of the host machine), and does not revert it back to GMT later. There is a work-around in appropriately setting the property user.timezone for the WAS profile hosting the application, but my question is that why should WAS change the TimeZone of the host JVM to locale (and then does not revert it back to the original), when the application explicitly sets it to GMT at startup? Is it not making application dependent on the Application Server properties? Besides, the application has been running fine without making any use of Application Server specific feature on Application Servers ranging from JRun, Apache Tomcat to Websphere Application Server 6.0!
Any insight would be greatly appreciated.
Thanks,
Abhi
The application has been running without any problem on Websphere Application Server 6.0.2.13 for over a year now. Recently, we have migrated to WAS 6.1.0.9 (without any changes to the code that uses Dates and TimeZones). We have observed some issues in WAS 6.1 w.r.t the treatment of java.util.TimeZone. The application still sets up the TimeZone to GMT at the time of startup, but when WAS 6.1 processes requests submitted on JSPs, it seems to be changing the TimeZone of the host JVM to the locale TimeZone (set for the OS of the host machine), and does not revert it back to GMT later. There is a work-around in appropriately setting the property user.timezone for the WAS profile hosting the application, but my question is that why should WAS change the TimeZone of the host JVM to locale (and then does not revert it back to the original), when the application explicitly sets it to GMT at startup? Is it not making application dependent on the Application Server properties? Besides, the application has been running fine without making any use of Application Server specific feature on Application Servers ranging from JRun, Apache Tomcat to Websphere Application Server 6.0!
Any insight would be greatly appreciated.
Thanks,
Abhi