[Mono-bugs] [Bug 69194][Nor] New - Cache compares AbsoluteExpiration DateTime to GMT

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 7 Nov 2004 02:08:40 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by jhill@arcfocus.com.

http://bugzilla.ximian.com/show_bug.cgi?id=69194

--- shadow/69194	2004-11-07 02:08:40.000000000 -0500
+++ shadow/69194.tmp.19559	2004-11-07 02:08:40.000000000 -0500
@@ -0,0 +1,76 @@
+Bug#: 69194
+Product: Mono: Class Libraries
+Version: 1.1
+OS: other
+OS Details: FC1 and FC2
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Web
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jhill@arcfocus.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Cache compares AbsoluteExpiration DateTime to GMT
+
+Description of Problem:
+When an object is placed into the cache with an AbsoluteExpiration
+DateTime, that DateTime is compared to GMT rather than the local DateTime,
+causing cached items to expire prematurely (or, in other time zones,
+perhaps live too long).
+
+1.	Create an aspx file that places an object in the Cache with an
+AbsoluteExpiration sometime in the very near future, such as this
+CacheTest.aspx:
+
+<%@ Page Language="C#" %>
+<script runat="server">
+                                                                          
+                                                                         
+    void Page_Load(Object sender, EventArgs e) {
+                                                                          
+                                                                         
+        // Obtain announcement information from Announcements table
+        // and bind to the datalist control
+                                                                          
+                                                                         
+        HttpContext.Current.Cache.Insert("CachedObject", "Hello", null,
+DateTime.Now.AddMinutes(10), TimeSpan.Zero);
+          if (null == HttpContext.Current.Cache["CachedObject"]) {
+                Response.Write("Cached Object was null!");
+          } else {
+               Response.Write((string)
+HttpContext.Current.Cache["CachedObject"]);
+          }
+    }
+                                                                          
+                                                                         
+</script>
+<html>
+<body>
+</body>
+</html>
+
+2.	Set your machine's time zone to one that is west of the Prime Meridian.
+ (i.e. GMT -6)
+3.	View the page in xsp or mod_mono, where the CacheTest.aspx page exists
+in the root application:
+ 
+mono /usr/bin/xsp.exe --root . --port 8080 --applications /:.
+
+Actual Results:
+Cached Object was null!
+
+Expected Results:
+Hello
+
+
+How often does this happen? 
+Always (If the cache is set to expire in less time than the difference
+between GMT).
+
+Additional Information:
+This behavior occurs on Mono 1.0.4 and 1.1.2