aspx thread: Scott Guthrie : problem about the Data Caching Example in QuickStart samples
Hey Scott,
http://aspfree.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/sam
ples/cache/datacache2.src
I was just running this example in the .net quick start examples.. and
noticed something that got me curious...
When you insert a new record, at the bottom of the page you get a message
stating the data was accessed from the cache or if it was read explicitly
from the xml file..
So after inserting some data, sometimes the message showed the data was got
from the cache, while other times it said that the data was received
explicitly. Why is it different at different times?
(1) Can you tell us exactly what happens behind the scenes? If possible, I
want the gory internal details.... :)
(2) How would it be possible to get the data explicitly all the time when an
update is done in the xml file?
On a separate note, I downloaded the above code and ran it on my machine.
Same situation. Then I changed the code a bit to try and see what was going
on. Before the "LoadData()" function, I tried to do a "wait" and see if the
cache took sometime to expire. Without realizing it, the code I entered in
was wrong in its syntax.... BUT when I ran the aspx program from my browser,
the code ran without any errors(no browser cache, and data was getting
inserted!)... only after a few minutes of trying again and again, did it
give me an error. This tells me that the .net runtime, or whatever component
thats responsible to detect a change in the code(would like to know what it
is), did not catch the change! So in essence, the aspx was not recompiled
immediately..
(3) Can you tell us why the above took place and how to fix it?
Thanks.
Girish
PS I still havent figured out how to do the wait or sleep on the thread..
can you shed some light here?