Architecture :: Too Many Connections On Single Page?
May 21, 2010
My ISP manager complains that my pages open too many connections and it should be dealt with immidiatly.Now, i'm not sure what exactly he means.Most of my pages look something a like : Two drop-down-lists, one gridview, and few other controllers.now, MOST OF THESE CONTROLLERS POST BACK AND FETCH INFO FROM THE DATABASE.each of the eventhandler create a new connection instance, open a connection, fetch info, and than closes the onnection.Thing is that many users visit the site at (probably) the same time, so i was wondering how could I decrease the number of connections?Perhaps making sure that the connections do close immidiatly post command execution?
We, at our company, are developing a file sharing application which will allow users to upload/download files. This application will be part of the suite of other applications. We will be adding a desktop client (windows app) which is an upload/download manager which will assist users to queue in multiple large files for upload/download. There are a couple of questions related to design for these applications:
1. We would like to implement Single Sign-On for all these applications (including desktop client). We would like users to login to web and once they do that, they can browse through applications without logging in again. We will be implementing a authetication service using WCF. The requirement is that we do not want to add authentication functionality to desktop client. So users will need to login to our web application. We can write cookie to user's machines and will work for web applications. Can the desktop client use the same cookie to autheticate itself? Or there are other ways we can achieve it? 2. We also do not want that when desktop client is uploading/downloading multiple files that its session is expired and the user need to re-authenticate through web. How can we achieve it? How does other Upload/Download Managers (like MS File Trasnfer Manager) work?
I'm building a new n-tier web application and I would like to know the performance differences between developing my tiers in one single assembly (each tier with its own namespace) or into different assemblies, one for each tier.
I'm planning to make an ASP.NET webserver that provides all kinds of functions, like an API. There will be quite alot functions that can easily be grouped (datasystem, userAccount, fileSystem, and so on). I can make multiple services (asmx files) into a single webserver, and let the clients connect to whatever service(s) they need. However, I'm not sure if it's a wise thing to do... Pack everything into 1 big service(1 asmx file), or split up into many smaller services? How about:
- performance/memory on the server (a client that connets with 1 or 6 services)
- Maximum connections (we will use a Windows XP Server edition computer)
There will be about ~30 computers using it. In a worst case scenario, they each computer could make use of 6 services at the same time, if I decide to split it up. A single client could make use of the fileSystem, account, dataSystem and several other things at the same time.
I want to store the bulk datas in single click . My problem is, i have a one pop up page( for item details) in that page i have another grid(for serial details, which is contain serial no details like, serial no,its date, asset no, etc.,,)1, I have to select the item grid , and have to update the its serial no details, ( for an item can contain more than one serial no's based on its quantity).2, When i select the first item and adding some serial no details too.3, Then again i choose next item and doing some update like adding serial no, now i have a problem like i have to kept these data's ( like first item serial no details) and second added serial no details ,,now i have to insert all the details in a final submit, i don't know how to do that and which concept i can use,
I am working on 3 tier architecture: UI, BL, DAL. In my UI i have following code for Asynchronous page processing:
[Code]....
But I want a database fetch operation to be performed in this asyncronous method. And due to 3 tier arch. i am unable to do this in UI Layer. Can anyone guide me that how can I implement Asynchronous processing in 3 tier architecture? Note: If you are going to place EndAsyncWork1 in DAL then show that how can I return a value back to UI layer from this function.
I am using a custom error page in IIS 6:<customErrors redirectMode="ResponseRedirect" mode="On" defaultRedirect="Error2.aspx"/>I want to disable authentication for the custom error page because the error being raised is related to an authentication module and I don't want to get into an infinite loop and I want to display a clean error page to the user. I have been trying the following configuration to do that.
I have simple asp.net web service, for monitoring and managing about 10 computers, with 4 webMethods and all of this methods are quite simple. In general they look sometning like: (1)make WMI connections to certain machine, (2)do some simple task, (3)return result.
Problem is that WMI connections to remote computers takes about 15s and I offten need to call 2 or 3 methods successively for the same machine.
From what I know, there is new instance of my service class (public class MonSvr :
System.Web.Services.WebService ) created every time webMethod is called.
So how can I share WMI or DB connection betwen all instances of my service that I could reuse this connection ? When there all multiple calls to webMethods of my service, does then each instance of web service runs in separate thread ?
I've inherited a very large project in ASP.net, SQL 2005 and have found where some SQL connections are not closed - which is bad. Without going thru every line of code, is there a way to detect if connections are not being closed? Performance counter? as a follow up - how does SQL reclaim unclosed connections. I'm using non-pooled connectionstring.
I have a stored procedure that returns 3 tables within the single recordset it returns. If I set a SqlDataSource to get data from this procedure, it works, but it only returns the first table. I want to have a GridView display the data from the 2nd or 3rd table using a SqlDataSource, but I can't figure out how to specify a particular table.
While there are some posts discussing this out there, I can't get a definitive answer about whether or not this is even possible (?). In a worst-case scenario, I can create another SP that only returns the 3rd table - but that creates a little maintenance headache that I would prefer to avoid.
For context: First of all, I am new to LINQ, as I have been using SubSonic for quite some time now.
I have two tables, Users, and Affiliates. They both have a very typical schema. The FK that joins them is the UserId field, which is in the Affiliates table. I want to create a LINQ query that pulls the Username from the Users table using the AffiliateId value. The AffiliateId is a primary key of the Affiliates table.
I have tried to accomplish this using many variations of the following code:
[Code]....
In the above query, I expect to get a single row result set. However, I instead receive the entire table of results.
How can I make this work? I have yet to see an example or article out there to do what I am trying to do.
I have huge excel files that I have to open from web browser. It takes several minutes to load huge file. Is it possible to open a single worksheet (single tab) at a time from excel file that contains many worksheets? I have to do this using C# / asp.net MVC
I am trying something apart of my boundries, is there any way to disable a single intem in dropdownlist or stop the ddl change event for a single item.
I'm having some problems with connections to an SQL database not closing after being opened, which is maxxing out the pool and causing the site not to load any of the dynamic content (until eventually unused idle connections get close, as the problem seems to go away after a while).
I've been through my code several times and can't figure out where things are not being closed properly.
Is there a surefire way to make sure these connections are properly closed? Or to pinpoint where the problem lies?
Most places in the site I am using ObjectDataSource. You don't need to close a connection when using that, do you?
Where ObjectDataSource isn't used, a developer wrote this method and put it in a class file called "common.cs":
[Code]....
I searched the entire solution for every instance of "common.openDatabase()", and where it occurs I make sure there is a "cmd.Connection.Close();" that follows.
Am I missing something or doing it wrong?
Here's an example of where a db connection gets opened and then (purportedly) closed:
I'm having an issue with my hosting provider (winhost.com). My app is built on ASP.NET 4 MVC 3. Up until a few days ago, everything was running fine. All of a sudden I've started getting 503 errors when trying to access my site (wikipediamaze.com). It doesn't happen all the time, just most of the time.
When someone starts playing the game a request is made to wikipedia.org to get the contents of the page for the current step in the puzzle. Basically I'm screen scraping wikipedia.org, injecting some html and then displaying the results. All of my web requests are closed immediately after receiving the data.
What winhost is telling me is that there are connections remaining open and causing any additional requests to the site to get the 503 Service Unavailable Error. What I can see from my end is that only 1 request is ever allowed to be made to wikipediamaze.com at a time. If you keep refreshing the page you'll eventually get the HTML but all subsequent requests (css,images,js) all get the 503 error. Even pages that don't ever call out to wikipedia.org.
If it was an issue with connection throttling in IIS, do both incoming and outgoing (requests made internally) fall in to the same bucket? If I'm sure all of my connections are being closed (and I've never had this issue before) what else could cause this?
I have a problem with the connection of external files - northwind.MDF Connection to SQL Server is fine. But to connect to external files wrong. Error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Intance Specified)
Is this necessary to open and close connection when i am using SqlDataAdapter and DataSet to get data from from table from databse in sql server? Which one will be better to use in the following code. Code1 or Code2.
Code: 1 With open and colse connection
public DataSet GetFAcadSlidingImage() { SqlConnection con = GetConnection(); cmd = new SqlCommand("Pro_GetFAcadSlidingImage", con); cmd.CommandType = CommandType.StoredProcedure;
[Code].....
Code:2 Without open and colse connection
public DataSet GetFAcadSlidingImage() { SqlConnection con = GetConnection(); cmd = new SqlCommand("Pro_GetFAcadSlidingImage", con); cmd.CommandType = CommandType.StoredProcedure;
Here comes the noob question of the day... along with a little background to give the best possible response.I have been working with Intranet asp.net/vb project. A few (3 - 5) .aspx pages had been created before the project was handed down to me, along with a DataAccess module and a ReportTools module (both of these modules are located in the App_Code directory. Things are starting to get slightly more large-scale now, with a dozen or so pages, and I'm looking for the best way to organize my files, classes and modules.
I have a single .aspx and .aspx.vb webpage that needs a specific class to be implemented which will hold values accross post back. This class will only be used within this specific page, no where else. I could create this module (or class) within the App_Code directory, but it would seem better to have this class file located in a folder with the implementing page. An example would be (using the attached screenshot below) having a folder within "Merchandising", which will be titled "SalesRecapByDate" and within this folder will exist the SalesRecapByDate.aspx and SalesRecapByDateData.vb (my class/module). Only problem with this, I cant figure out how to import the class/module into my .aspx.vb page.So my question!! Would it be best to:A) Have a folder within the "Merchandising" directory, to hold my page and its corrosponding class?B) Create sub folders within App_Code to organize things a little better according to how / where they are used
I have a rectange that has some printable elements. I want everying in the rectangle to print on one page. I don't want a new page ALWAYS before the rectange prints, I only want a new page if the entire rectange wont print on the current page
I have a site, developed by an outside company, which requires logon for all pages.
We'd like to add a single page to the site that DOESN'T require the user to be logged in...so they can click the link on the logon page to view "T&C's" type info.