Synchronizing And Coordinating Processes On A Web Farm?
Oct 15, 2010
in my ASP.NET app happen asynchronously (i.e in background threads without any access to HttpContext). Let me take an example of one such action. The app would be deployed to a web farm soon.
The background threads would be processing files deposited to a network share location. So, when the app starts, I create a FilesystemWatcher to monitor activities on the desired network share folder.
As soon as a new file arrives, the code processes it and marks it as completed processing.
The problem is with multiple servers watching the same network share, the same file might get processed on different machines, meaning redundant results. On a single server, I use locking mechanisms to prevent race conditions.
Now how to prevent the same on a web farm?
View 3 Replies
Similar Messages:
Jan 22, 2010
I have a page with a datalist and a formview. The page holds a newsletter and access to archived newsletters. I have set up the datalist so that each item contains a button control with a bound text. The formview holds an object with a bound data attribute. I have the page running with linq and the intitial page populates perfect. What I need to do though is be able to click a button in the datalist and have the formview rebind to the correlating data.
[Code]....
View 1 Replies
Sep 29, 2010
I have a C# problem I need to synchronize two MS Access tables from two different databases(two databases over a network) which is quite similar, I thought of using two different OleDbConnections and two DataAdapters to fill a Single DataSet and then manipulate the data in the DataSet, I think the source table (database with the primary data) should be loaded first (into the DataSet) then the secondary table from the remote database should subtract the existing records in the DataSet to get the difference then the difference should be Appended to the remote table, but I don't know how to remove the same records from the DataSet and to send the remaining records to the secondary database.
Here is some code I already have, but I don't know how to get this to work:
[Code]....
View 1 Replies
Jun 6, 2010
I am trying to develop a web application(Using ASP.NET and c#) that uses a specific database hosted on web server. I will have another desktop application that will use a local database. Both databases have same structure and data at start up. Then databases will change when users add data to web application and an employee adds data to the desktop application. After a while I have to sync both databases.
What will be best way to do this? Is there any opensource example/ starter kit to start with?
View 3 Replies
Apr 26, 2010
I'm building a Javascript application and eash user has an individual UserSession. The application makes a bunch of Ajax calls. Each Ajax call needs access to a single UserSession object for the user.
Each Ajax call needs a UserSession object.
Data in the UserSession object is unique to each user.
Originally, during each Ajax call I would create a new UserSession object and it's data members were stored in the ASP.NET Session. However, I found that the UserSession object was being instantiated a lot. To minimize the construction of the UserSession object, I wrapped it in a Singleton pattern and sychronized access to it.
I believe that the synchronization is happening application wide, however I only need it to happen per user. I saw a post here that says the ASP.NET cache is synchronized, however the time between creating the object and inserting it into the cache another Thread could start construction it's another object and insert it into the cache.
Here is the way I'm currently synchronizing access to the object. Is there a better way than using "lock"... should be be locking on the HttpContext.Session object?
[code]...
View 2 Replies
Mar 10, 2010
I'm running IIS 7 on Server 2008, with a single AppPool for an application which is basically just a collection of ASP.NET WebMethods. Some of these methods process for hours before they return. What's weird,is that sometimes when I launch multiple simultaneous requests IIS spins up a single w3wp process (and seems to share it amongst the requests) and other times it spins up multiple w3wp processes.
View 1 Replies
Dec 9, 2010
I want to get all the processes that is meant for a particular session.
i.e if there are two persons who are using my web application then i want to get all the processes used by user1 and all the processes used by user2.
I can get all processes by writing Process.GetProcesses() but how to get it in a group.
e.g:
User1: Process342
User1: Process151
User2: Process452
User2: Process674
User2: Process111
View 1 Replies
Jan 14, 2010
What I'm finding is that if I externally change the date in the text box that the CalendarExtender is attached to (I'm also using an image button with a calendar image to invoke the calendar - like the last example on the
samples page), the date on the calendar does not stay in sync.
Example:
page loads. text and calendar are set to 1/14/2010. cool. on the click event of a button elsewhere on the page I set the date in the text box to 12/15/2009.
I would expect that clicking on the calendar button to display the calendar would show December 15, 2009 in the calendar, but instead it's still stuck on January 14, 2010.
What's involved in programattically setting the date in the CalendarExtender control
in javascript?
View 4 Replies
Apr 19, 2010
After editing the list of hardcoded items in a RadioButtonList on a ASP.NET page via the Design view, I find that the HTML source for the RadioButtonList still does not update to the latest list of items i.e items are still the ones before the changes.
Is there a way to synchronize what appears in the Design view and the actual HTML source? Or do I have to delete the RadioButtonList and recreate it?
View 1 Replies
Sep 20, 2010
I'd like to display an animated gif after user presses a submit button which causes postback. I'm following Joe Stagner's tutorial
here. The page worked fine. But now that I've added the update panel around the button and then an update progress with a gif in it, the app doesn't run.
Now, when the button is pressed, the animated gif appears and runs for about three seconds or so (due to the artificial latency added as per the tutorial - System.Threading.Thread.Sleep(3000) ) and then it stops, nothing returns from the server.
What am I doing wrong and what am I not understanding with this Ajax process and the server?
(by the way I'm using the toolscript manager that came with the Ajax control toolkit, don't know if that matters)
[Code]....
View 4 Replies
Jan 15, 2010
I'm firing the my ModalPopupExtender from a server side button click (bthAuth) and then need to hide that button after my processing is complete. When btnAuth.Visible = False is called it displays the ModalPopupExtender. If I remove this piece of code the window goes away like it should.
<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="btnAuth" BackgroundCssClass="modalBackground" PopupControlID="ModalPanel"> </cc1:ModalPopupExtender>
btnAuth_Click():
bunch of stuff here()
btnAuth.Visible = False -- This is what is causing the ModalPopupExtender to stay displayed.
On Page Load:
btnAuth.OnClientClick = String.Format("fnClickUpdate('{0}','{1}')", btnAuth.UniqueID, "")
Function:
<script type="text/javascript">
function fnClickUpdate(sender, e)
{
__doPostBack(sender,e);
}
</script>
View 4 Replies
Feb 4, 2010
I'm currently experiencing and issue on whether to say a connection has been left open due to my code or if it's left open due to ADO.NET pooling. Here's a sample of my code:
Public Function ExecuteDataTable(ByVal strStoredProc As String, Optional ByVal objParams As SqlParameter() = Nothing, Optional ByVal cmdType As CommandType = CommandType.StoredProcedure) As DataTable
Dim objDt As New DataTable
Dim objAdapt As New SqlDataAdapter
Dim objParam As SqlParameter
Try
OpenDb()
If Not IsNothing(objParams) Then
AddParams(objParams)
End If
objAdapt.SelectCommand = New SqlCommand
With objAdapt.SelectCommand
[Code].....
Then when I go to open up the SQL Mgmt Studio, I look into the processes and the particular connection that has ran with the SQL that my function runs appears to remain open. So to me, it looks like ADO.NET is performing some kind of pooling. Is it safe to make that conclusion? How would I be able to tell if the connection is available to be used again by the ADO.NET pool?
View 2 Replies
Sep 21, 2010
When IIS restarts an ASP.Net (2.0) web application, it can either:
Recycle the AppDomain: Unload the AppDomain and load a new AppDomain on the same process (e.g. when HttpRuntime.UnloadAppDomain() is called, when web.config is changed).
Recycle the process: unload the AppDomain and load a new one on a new process (e.g. when invoking Recycle command on an AppPool via inetmgr, or when memory limit is reached).
Due to some internal reasons (trouble with legacy native code we depend upon), we cannot allow the first option. We just can't load the application twice on the same process.
Can IIS be somehow told to never allow worker process reuse?
I've tried preventing it myself by tracking whether an application has already started on a process once using a Mutex, and if so - throwing an exception during Application_Start()); I've also tried terminating the process by calling Environment.Exit() during Application_End(). The problem with both methods is that it causes any requests that arrive during Application_End or Application_Start to fail (unlike a manual process recycle, which fails absolutely no requests because they are redirected to the new process right away).
View 2 Replies
Mar 19, 2011
How can I show loading image for the user while executing long running process in an ASP.Net Ajax application? Is there a way other than using Page Methods? Any ideas?
View 2 Replies
Jul 6, 2010
Web farm is used for multiple request and multiple user using switching among them.
Web Garden creates worker processes for every processor individually for one user.
Is it possible to use worker process as a switch and convert it into Web Farm that can allocate multiple processor on bases of algorithm?
View 1 Replies
Sep 29, 2010
Currently have an asp.net web site which is contained on 2 web servers which are load balanced i.e. web farm.
I would like to have some code which would allow me to call a particular server and execute a method on it. I WANT TO do this so that i can force all web servers to refresh their cache via a web page on the site.
Use Case is: Admin user logs into site and makes a change to a setting which is cached and then clicks "Refresh web server cache" button which then calls the update cache method on each of the servers. this is to prevent me from having to restart the app pool every time a cached setting is changed.
View 2 Replies
Feb 24, 2011
Given the idea of a web application (.NET 3.5+)
Browser
web app
the authentication using forms will result in a similar line of code
FormsAuthentication.SetAuthCookie(strUsrNm, True)
this is fine in a non load balanced server instance. how does authentication work in a load balanced stuation (no sticky session/infinity), and you cannot store the client IP, users password or login in the browser.
Browser
Load balancer
Web app (on server 1) || Web app (on server 2)
limitations: no database sessions, no AD server (for example: cater for external users)in short - in a load balanced situation how does the appliation know who the user is if they authenticated against the other server without re-authenticating.
View 1 Replies
Sep 1, 2010
I have production server on our intranet and we have website on remote server with its own database. Now we want to sync some tables from our local database to remote database at some interval of time. I have own idea that if data sync is fail than we should get email about that from remote database.
For above scenario I was looking some ideas from you guys and different method to do it. I know about replication of database how to do that. Can we do it by asp.net, SSIS package which will be easy.
View 3 Replies
Mar 23, 2011
difference between the Web Farm and Web Garden with some real time scenario?
View 2 Replies
May 6, 2010
My web app must access database via web service, and can not access databse directly.
In case my web app is deployed into a web farm, to remember the user's preference, I think I can't use ASP.NET Profile directly.
View 3 Replies
Mar 11, 2010
We have a small web farm(2 servers) balanced by the built in network load balancer in Windows 2003. We have a few pages that use page caching. My question is: Is it possible that that a given user could cause a page to be cached and another user see that content? Here is the page directive for the page in question:
<%@ OutputCache Duration="1" NoStore="true" VaryByParam="none" %>
The reason the duration is set to "1" is to ensure that the page isn't cached any longer than 1 second because of transactions that actions on the page can trigger.
View 2 Replies
Apr 6, 2010
So I have an ASP.Net web forms application that is using URL Routing. It works great on the old single server shared web hosting account. It has been moved over to a new platform that appears to be a web farm. When a postback happens it now just refreshes the page and the event handler is not envoked. Another thing I've noticed is they put the application into a sub-folder on the account and are using ISAPI Rewrite to point the domain to the sub folder.how to get the postback to execute on this web farm?
View 1 Replies
Mar 28, 2011
I am working on a project where we want to provide link to download excel file.We are using NLB for load balancing,NLB cluster contains 3 machines.constraint is that excel file to be downloaded is available on a single machine.How to ensure that HTTP request underneath will served from the same mahine?
View 1 Replies
Aug 16, 2010
I'm considering using the HttpContext.Items HashTable to store reuseable user data (per user) instead of in the Session,
I'm hoping that this data is stored on the client and not on the server, but I did not see anywhere that this is the case...
Also, is there any drawback or loss of data that can happen when using web farm or clustered web servers ?
View 1 Replies
Jan 17, 2011
We have an array of about 12 servers serving a website. Over the past few hours, one single server has started throwing exceptions for WebResource.axd and ScriptResource.axd requests.
Exception
System.Web.HttpException - This is an invalid script resource request.
Stack Trace
at System.Web.Handlers.ScriptResourceHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Broken server URL
/WebResource.axd?d=S6kjkBsrIKni9uO5HCkv0c8eYObzibWXn9R6A7Yr_Fy7CW4dRFZm1HfcnUTEZ8xBYZDM-5zeTVk1tTgC1hp7d5YYw3o1&t=634308186300177825
All other servers URL
/WebResource.axd?d=yj6PW1hbOvqhMkOh2gYGlw2&t=634207187366247462
I have checked the web.config, machine.config for every server and they're all identical. The only difference been able to find so far is that prior to the problem commencing, the servers were patched, after which, the problematic server looks to be using different version of the System.Web.dll to the others?
View 2 Replies