I have an aspx page with some OSI Pi database queries that can be run one time just fine, but then will not run again until I either close and reopen the project in VS (debug mode) or kill the w3wp.exe process in task manager (compiled running through IIS).
I am using the OleDbConnection Object with the OleDbCommand and OleDbDataReader objects to run the queries and get the data I need. I am setting the Command object to Nothing immediately after running the ExecuteReader method and closing the DataReader object
before each new query. I am closing the Connection object I make before exiting the routine. What can be causing this to remain in memory?
Thanks - I forgot about Using, though I have used it a lot in the past. With my current job I am doing a lot less .net programming in general so I am a bit rusty. Additionally this is my first web project and it has made for a learning curve.
I will add Using to my code when I get back to the office on Monday and will let you know how it turns out.
OK, I have Using . . . wherever I am using a connection, a command, or a datareader.
On the first couple of tests it seemed to have fixed the problem. But IIS (w3wp.exe) is still freezing up for some reason. What else could be causing this? I can attach my code if you think it would help, but it is a bit lengthy.
I don't understand exactly what you are asking. On Page_Load, this app checks to see if the user has made a selection from one of several combo boxes on its first page. If not, it loads that first page with the combo boxes populated by (OSI Pi OleDB) database
queries. That page works just fine as long as w3wp.exe is not still running from the last load of the page. Once the user makes a selection, the code runs several more queries on databases located on the same server and generates a reports page based on
the data retrieved from the new queries.
I am using the Using. . .End Using for every database related object in the code now.
I am using VB. I don't understand what you mean by"something /// special".
OK, after experimenting more, I have found that the page will load just fine - many times in a row - but only if no more than a minute or so elapses between opening the prior window and loading the new one. After that period of time, the window will not
load. Please help.
bakershack
Member
19 Points
22 Posts
w3wp.exe doesn't exit when the browser window closes
Feb 18, 2011 09:44 PM|LINK
I have an aspx page with some OSI Pi database queries that can be run one time just fine, but then will not run again until I either close and reopen the project in VS (debug mode) or kill the w3wp.exe process in task manager (compiled running through IIS). I am using the OleDbConnection Object with the OleDbCommand and OleDbDataReader objects to run the queries and get the data I need. I am setting the Command object to Nothing immediately after running the ExecuteReader method and closing the DataReader object before each new query. I am closing the Connection object I make before exiting the routine. What can be causing this to remain in memory?
ignatandrei
All-Star
134832 Points
21599 Posts
Moderator
MVP
Re: w3wp.exe doesn't exit when the browser window closes
Feb 19, 2011 05:01 AM|LINK
use
using
Such as
using(connection ...)
{
using(comnand){
using(datareader)
{
}
}
}
shri00799
Member
9 Points
10 Posts
Re: w3wp.exe doesn't exit when the browser window closes
Feb 19, 2011 05:06 AM|LINK
i used as u mentioned above still connection remains. The w3wp.exe is not closing or not reducing its usage of memory if the users get reduced.
because of this i need to restart IIS everyday which is tedeuous
ignatandrei
All-Star
134832 Points
21599 Posts
Moderator
MVP
Re: w3wp.exe doesn't exit when the browser window closes
Feb 19, 2011 05:11 AM|LINK
please show code.
bakershack
Member
19 Points
22 Posts
Re: w3wp.exe doesn't exit when the browser window closes
Feb 19, 2011 01:38 PM|LINK
Thanks - I forgot about Using, though I have used it a lot in the past. With my current job I am doing a lot less .net programming in general so I am a bit rusty. Additionally this is my first web project and it has made for a learning curve.
I will add Using to my code when I get back to the office on Monday and will let you know how it turns out.
Thanks,
Kelly
bakershack
Member
19 Points
22 Posts
Re: w3wp.exe doesn't exit when the browser window closes
Feb 19, 2011 07:52 PM|LINK
Also, is w3wp.exe hanging a known issue with not using Using? Or is there smething else I need to check for?
bakershack
Member
19 Points
22 Posts
Re: w3wp.exe doesn't exit when the browser window closes
Feb 21, 2011 03:13 PM|LINK
OK, I have Using . . . wherever I am using a connection, a command, or a datareader.
On the first couple of tests it seemed to have fixed the problem. But IIS (w3wp.exe) is still freezing up for some reason. What else could be causing this? I can attach my code if you think it would help, but it is a bit lengthy.
Thanks again for your help,
Kelly
ignatandrei
All-Star
134832 Points
21599 Posts
Moderator
MVP
Re: w3wp.exe doesn't exit when the browser window closes
Feb 21, 2011 03:14 PM|LINK
do you use something /// special?
bakershack
Member
19 Points
22 Posts
Re: w3wp.exe doesn't exit when the browser window closes
Feb 21, 2011 03:27 PM|LINK
I don't understand exactly what you are asking. On Page_Load, this app checks to see if the user has made a selection from one of several combo boxes on its first page. If not, it loads that first page with the combo boxes populated by (OSI Pi OleDB) database queries. That page works just fine as long as w3wp.exe is not still running from the last load of the page. Once the user makes a selection, the code runs several more queries on databases located on the same server and generates a reports page based on the data retrieved from the new queries.
I am using the Using. . .End Using for every database related object in the code now.
I am using VB. I don't understand what you mean by"something /// special".
bakershack
Member
19 Points
22 Posts
Re: w3wp.exe doesn't exit when the browser window closes
Feb 21, 2011 03:59 PM|LINK
OK, after experimenting more, I have found that the page will load just fine - many times in a row - but only if no more than a minute or so elapses between opening the prior window and loading the new one. After that period of time, the window will not load. Please help.