I am running into an odd problem, and this is the only thing I can think of. I'm storing a list in cache, and I am randomly losing items from my list as users use the site. I have a class that is called that either goes to cache and returns the list from there, or if the cache is over a certain time frame old, it goes to the database and refreshes the cache. So when I pull the data from cache, this is what it looks like....
results = (List<Software>)cache["software"];
And then I return results and do some processing, filter for security, and eventually it winds up on the screen. For each Software record, there can be multiple resources attached to it, and based on how the security goes they may see some, all, or none of the records. So in the security check it will remove some of those resources from the software record.So my question is.... when I return my results list, is it a reference directly to the cache object? So when I remove a resource from the software object, it is really removing from cache as well? If that is the case, is there any way to not return it as a reference?
edit: I think I may have just answered my own question.... so if I do something like this:
results = new List<Software>((List<Software>)cache["software"]);
it will copy the cached list to my results list, correct?
I have a datagridview control that I'm using to display cache data to the end used on a web form. The issue that I'm having is that every time I re-run the application, and the cache data is re-generated... it loads duplicate data that's being displayed to the end user. I can't seem to figure out how to keep this from happening.
What I would like to have happen is that only unique data rows be returned and cached for the end user. Unless there are new data rows on the database that needs to be included in the cache data results...the previous data results should not be duplicated. I've tried to change a few properties on the datagridview control, but nothing seem to keep this from happening.
I have a RESTful webservice. This webservice builds some information (which can take upwards of a couple seconds) and caches the contents.
This works well; however, suppose that many of the same requests come in at about the same time. In our current scenario, each request will build the content before caching. This is obviously not desired as it uses CPU time that could be better served elsewhere. What I would like to do is to suspend/block requests to the same url/cachekey until the content has been built and cached, at which time those other requests will be unblocked and simply fetch the content from cache.
I am not sure the best way. The following are options I have thought about:
Use string.Intern on that cache key and lock. Problem is that this could cause a deadlock if that string is used elsewhere. Use a ConcurrentDictionary and WaitHandle objects to allow other request to lookup in the dictionary if a request is being processed and then "wait" for the request to finish. This would at least give me a timeout capability but I am concerned with the performance of creating many wait handles.
We are adding tooltips to our ASP.NET MVC product, and we are getting the text from our database (technically, from a cached copy of the data). To do so, we created an Html Helper method:
The GetTooltipText method is in our BaseViewModel, and simply uses the passed in Id to fetch the tooltip from cache. Would this be considered a bad design? What other alternatives would we have?
I want to update my cached data , if there is any change in database. , if any change in database/tables happens then my cached data should be updated.
I have one issue on my localhost running website that is when i submit data from asp.net form . it don't clear the data permanentaly from the page history.like , i submit one record and after this one i double click on the textfields the previous values are shown ?
U are caching a list of items, then Add or update or delete method called. Approach 1)
A- Do the data change at the database. If success do B, C B- Remove the entire list from the Cache. C- Re-Cache the list on first read.
Approach 2)
A- Do the data change at the database, If success do B B- Do the same change at the cached items, and save more time.
Approach(2) probably will cause nasty difficult to spot bugs, because the data come from BLL and placed directly into cache, One can't assume no bugs will happen at the sproc, I am not worry about database runtime errors, runtime errors will show up, but I am worry about invalid data, or miss calculation. Can I proceed with approach (2) with caution? Is there a "best practice" principle which suggest not doing approach(2)?
Is there a way how I can check programmatically which user is used when my application accesses resources?
I have a production system which only our admin can access. Sometimes it is not clear what part of the system is wrong: Lets say when logging is not working. It is always possible that the web.config is wrong, but sometimes the directory is not accessible. It would make my life easier if I could be sure, that the user is used, that I expected.
I have a Menu page. If a user selects an Menu Item it opens a new IE Window using JavaScript. So user can open different parts of applications in multiple IE Windows. These Windows have the same Session.
My issue is that these pages are accessed synchronously? If one of the child window is waiting for an action to be finished no other request from any other child window is processed. Is it because of using Session variables?
Update: This is only happening to the windows having the same parent. If I have IE child windows from different parent windows then this issue is not there.
There is a UserControlA which was already developed when I joined on a project. It is in a Project which I will call MyProjectWeb and it's namespace is MyProjectWeb.Common.
[code]....
But to my surprise, I cannot create an instance of UserControlB in the same code file in WorkFlowManager. MyProjectWeb.Common namespace does not even contain a UserControlB. When I compile I get obviously get a The type or namespace name 'UserControlB' does not exist in the namespace 'MyProjectWeb.Common' (are you missing an assembly reference?)
Why is that I can reference UserControlA but not UserControlB which are in the same namespace from the WorkFlowManager cs file? If I access the MyProjectWeb.Common namespace anywhere inside the MyProjectWeb, I can see both the user controls. Anywhere to look for errors?
I am thinking to create a web service for a SQLDB, I have created a simple database with two three tables tbldestination, tblflights and tblbooking.my big problem is how can i enable my database to be accessed through web service?
I am running a test page on a local server that I want only to be available to comouters that are running on the LAN. However, My web page can be accessed over the internet, how can i stop this?
The page is running on a Windows Server 2003 pc using IIS 6.0
is there any way to stop share the static variable at multiple users....I need to create a new insatnce of static variables or not accessing the same static variables across multiple who are using the same site.....while googling i found like hisSystem.Threading.Interlocked.Increment(ref MyClass.InstanceCounter); by using can I do....or is there any other way to stop accessing the static variables accross multiple instances of my site......and in my scenario i cannot use rely on session variable also
I am finding it quite awkward. I have registered the user controls and they are actually being parsed as I can view the controls I have placed on them. Problem is that I cannot access them in code behing. Even when I place them, their tags are not represented in the intellisence drop down. What could be causing this? I am placing them on a page residing in a master page setting. The controls are declared on the child page.
i have the following problem: i work in web application and only today. any control i put on the page, when trying to access it from behind code. it doesn't appear at all. what are the probabilities and reasons for this problem. note:i work from a thin client. they make some maintenance on their server today. and after that i find this problem.
the previous controls on my page can be accessed normally with out any problems.
Have I done something wrong ?I am running a web-site with simple .aspx files on a standalone workgroup Windows Server 2008 called 'Max'.I had assumed that the .aspx files were accessed by the 'Network Service' account.The application pool for the website is running with 'Network Service' as the process account.I was puzzled, since 'Network Service' had no permission on these .aspx files, and I coudln't understand how these files were being accessed at the file level.So I added event level auditing to the files, and I was suprised to learn that the .aspx files were being accessed by an account called Max$ (ie the computer account).Is this correct ?Why is the Network Service account not being used ??
We have created an ASP application with MS Access as back end. We have implemented this web application on our server machine and accessed the same from on my local machine.
Our application works fine when only one user accesses it (All insert, update works fine). But when multiple users connect to this application and try to update the database, then application get crashed. As per our knowledge, this is happening because of access database get locked, when one user open it in exclusive mode.
i am getting this error "A control with ID 'NewAssignTL' could not be found for the trigger in UpdatePanel 'UpdatePanel'. " i have 2 problems i cannot access my dropdownList control from code behind and i triggers cannot access the control.
How to get that how many pages accesses by a user in a website.
Actually, rather then putting code in each page I want some generalized method/technique that if user Logged to a website and during his Login period what was his activity and which page(s) he accesed.
Note:
1. My website pages are under MasterPage. 2. MasterPage has a MasterMenu. 3. For singlePage activity I used Page.GetType.Name