<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>State Management</title><link>http://forums.asp.net/22.aspx</link><description>Managing ASP.NET state - ViewState, Application, Session, etc. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=69&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Simultaneous modifying a disconnected dataset in Cache?</title><link>http://forums.asp.net/thread/1177457.aspx</link><pubDate>Tue, 24 Jan 2006 13:43:26 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1177457</guid><dc:creator>mbanavige</dc:creator><author>mbanavige</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1177457.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=22&amp;PostID=1177457</wfw:commentRss><description>&lt;p&gt;The&amp;nbsp;thread safety you refer to applies to reading and/or writing to single items of the Cache.&lt;br /&gt;This thread safety does not apply to the objects themsleves once you have obtained a reference to them from the Cache.&lt;/p&gt;
&lt;p&gt;If you begin manipulating properties of a dataset that was retrieved from the&amp;nbsp;Cache, it is absolutely possible for two threads to make inconsistent updates unless you perform some form of synchronization for your dataset object.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Simultaneous modifying a disconnected dataset in Cache?</title><link>http://forums.asp.net/thread/1177218.aspx</link><pubDate>Tue, 24 Jan 2006 07:14:25 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1177218</guid><dc:creator>sun21170</dc:creator><author>sun21170</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1177218.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=22&amp;PostID=1177218</wfw:commentRss><description>But a cached item does have an &lt;font color=#ff0000&gt;inbuilt locking mechanism&lt;/font&gt; since it's thread safe (the official documentation says about Cache type&amp;nbsp;- "This type is safe for multithreaded operations."). So no 2 users (2 users means 2 different threads in ASP.Net)&amp;nbsp;can modify a cached item at the same time. &lt;strong&gt;Then it seems no locking needs to be implemented for a cached item.&lt;/strong&gt;</description></item><item><title>Re: Simultaneous modifying a disconnected dataset in Cache?</title><link>http://forums.asp.net/thread/1176862.aspx</link><pubDate>Mon, 23 Jan 2006 21:50:45 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1176862</guid><dc:creator>mbanavige</dc:creator><author>mbanavige</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1176862.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=22&amp;PostID=1176862</wfw:commentRss><description>&lt;p&gt;The Cache&amp;nbsp;actually holds references the real object that exists in memory - thus keeping that object alive. &lt;/p&gt;
&lt;p&gt;When you retrieve the object from the cache, you are actually&amp;nbsp;retrieving a reference to a live object that another person on another page&amp;nbsp; may also be referencing.&amp;nbsp; If you do not implement any form of locking during updates to that objects properties, then it is entirely possible that&amp;nbsp;multiple users&amp;nbsp;could make incompatible changes.&lt;/p&gt;
&lt;p&gt;Here's an interesting read: &lt;a href="http://west-wind.com/weblog/posts/1214.aspx"&gt;http://west-wind.com/weblog/posts/1214.aspx&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Simultaneous modifying a disconnected dataset in Cache?</title><link>http://forums.asp.net/thread/1176829.aspx</link><pubDate>Mon, 23 Jan 2006 21:25:38 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1176829</guid><dc:creator>sun21170</dc:creator><author>sun21170</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1176829.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=22&amp;PostID=1176829</wfw:commentRss><description>&lt;p&gt;&lt;font color=#ffa500&gt;Should I be concerned, if in my code I am at times modifying the dataset stored in application cache?&lt;/font&gt; &lt;font color=#ff0000&gt;I am thinking what would happen if two requests over the web cause the dataset in cache to be modified at the same time.&lt;/font&gt; OR ASP.Net will automatically lock the cache data during modification.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By modifying the dataset, I mean changing the dataset row data in 'memory', without going to the database. For example, I may change the 'ParentID' column of a specific datarow to&amp;nbsp;the value '1125'.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I am using the 'Cache' object of the Page class to store data? &lt;em&gt;&lt;font color=#0000ff&gt;The Application.State object provides a lock method when modifying the state data, but 'Cache' object does not have any such method.&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color=#000000&gt;Thanks&lt;/font&gt;&lt;/p&gt;</description></item></channel></rss>