db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject [DISCUSS} Server TimeZone
Date Fri, 09 Feb 2007 00:17:12 GMT
Here is a proposal to add the ability of a user to get the time at  
the server in a portable way.

This should allow an application to avoid time skew by using the time  
as seen by a single source, the server to which the  
PersistenceManagerFactory is connected.

ServerTimeZoneID: the time zone ID of the server to which this  
PersistenceManagerFactory is connected, for use with the  
PersistenceManager method getServerDate
If ServerTimeZoneID is specified, the value must correspond to a  
valid time zone ID as returned by TimeZone.getAvailableIDs(). The  
implementation uses the ServerTimeZoneID to implement the  
getServerDate method. If ServerTimeZoneID is not specified, the  
implementation might use proprietary methods to determine the time  
zone in which the server is located. If ServerTimeZoneID is not  
specified, and the implementation cannot or does not use proprietary  
methods to determine the server time zone, then the default time zone  
ID of the Java VM is used.

12.17 Server Date
java.util.Date getServerDate();

Time skew is a phenomenon in which machines connected together in  
client/server configurations might have clocks that are not perfectly  
synchronized, and the time as seen by different clients might differ.  
In order for the application to avoid time skew, this method can be  
used to acquire a Date instance corresponding to the UTC Date as seen  
by the server. Clients using this method can order their operations  
according to a single time source.
Implementations use the setting of the server time zone to prepare a  
Date instance that represents UTC time on the server.

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!

View raw message