Click here to Skip to main content
15,890,336 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionA question regarding website design Pin
James Shao14-Dec-09 4:25
James Shao14-Dec-09 4:25 
AnswerRe: A question regarding website design Pin
Abhishek Sur14-Dec-09 5:03
professionalAbhishek Sur14-Dec-09 5:03 
AnswerRe: A question regarding website design Pin
Abhijit Jana14-Dec-09 5:59
professionalAbhijit Jana14-Dec-09 5:59 
AnswerRe: A question regarding website design Pin
James Shao14-Dec-09 12:20
James Shao14-Dec-09 12:20 
QuestionApplication State object is destroyed - Dont know why? Pin
vivasaayi14-Dec-09 1:28
vivasaayi14-Dec-09 1:28 
AnswerRe: Application State object is destroyed - Dont know why? Pin
Abhishek Sur14-Dec-09 3:58
professionalAbhishek Sur14-Dec-09 3:58 
GeneralRe: Application State object is destroyed - Dont know why? Pin
N a v a n e e t h14-Dec-09 5:47
N a v a n e e t h14-Dec-09 5:47 
GeneralRe: Application State object is destroyed - Dont know why? Pin
vivasaayi14-Dec-09 18:46
vivasaayi14-Dec-09 18:46 
Thank you for your comments.

I am sure that no clients are connected when the application starts up. And I dont want to implement Application.Lock() because I dont want the clients to wait and also the clients will not modify the updateManagerObject in the Application State.

I tested the UpdateManager class with Windows Forms and found that the Receiver Thread in UpdateManager class(Which downloads data from the Server) is orphaned sometimes. I simulated the same in the Web Service Also.

[WebMethod(Description = "Get the Current Quote")]
public string GetUpdate()	
{		
	//The following code re-initializes the updateManagerObject. So the Receiver 
	//Thread in the old updateManagerObject becomes Orphan.
	updateManager = new UpdateManager();
        Application[key] = cache;
	updateManager.Start();
	
	return updateManager.GetUpdate();	
}



This happens whenever the updateManager is re-initialized without destroying the old object. If the previous object is destroyed properly (by calling Dispose method) then everything works fine and no orphan Threads.

As you can see from the Web Service Constructor, the updateManager object is initialized when that object is null. Other wise it takes from the Application Object.

My question is How an object which is initialized and Stored in Application object becomes null? Since it becomes null the UpdateManager Constructor is called once again. How can I cal the Dispose() method?

I have no way to find the orphan threads, to destroy them.

Please suggest me some solutions.
GeneralRe: Application State object is destroyed - Dont know why? Pin
Abhishek Sur14-Dec-09 22:04
professionalAbhishek Sur14-Dec-09 22:04 
AnswerRe: Application State object is destroyed - Dont know why? Pin
N a v a n e e t h14-Dec-09 5:43
N a v a n e e t h14-Dec-09 5:43 
QuestionCross site Scripting XSS Pin
sachees12314-Dec-09 0:45
sachees12314-Dec-09 0:45 
AnswerRe: Cross site Scripting XSS Pin
SeMartens14-Dec-09 1:23
SeMartens14-Dec-09 1:23 
GeneralRe: Cross site Scripting XSS Pin
sachees12314-Dec-09 18:37
sachees12314-Dec-09 18:37 
AnswerRe: Cross site Scripting XSS Pin
Abhijit Jana14-Dec-09 6:37
professionalAbhijit Jana14-Dec-09 6:37 
QuestionASP.NET Application Development – Tools Pin
Karina.R14-Dec-09 0:39
Karina.R14-Dec-09 0:39 
AnswerRe: ASP.NET Application Development – Tools Pin
SeMartens14-Dec-09 1:25
SeMartens14-Dec-09 1:25 
AnswerRe: ASP.NET Application Development – Tools Pin
Abhijit Jana14-Dec-09 6:01
professionalAbhijit Jana14-Dec-09 6:01 
QuestionWeb 2.0 & JavaScript Framework Pin
Karina.R14-Dec-09 0:21
Karina.R14-Dec-09 0:21 
AnswerRe: Web 2.0 & JavaScript Framework Pin
SeMartens14-Dec-09 1:29
SeMartens14-Dec-09 1:29 
AnswerRe: Web 2.0 & JavaScript Framework Pin
Abhijit Jana14-Dec-09 6:05
professionalAbhijit Jana14-Dec-09 6:05 
QuestionDynamic item template Pin
sekannak14-Dec-09 0:20
sekannak14-Dec-09 0:20 
AnswerRe: Dynamic item template Pin
Dinesh Mani14-Dec-09 0:46
Dinesh Mani14-Dec-09 0:46 
GeneralRe: Dynamic item template Pin
sekannak14-Dec-09 0:59
sekannak14-Dec-09 0:59 
GeneralRe: Dynamic item template Pin
Dinesh Mani14-Dec-09 1:13
Dinesh Mani14-Dec-09 1:13 
Questionmultiple step oledb exception Pin
rajatarora13-Dec-09 22:28
rajatarora13-Dec-09 22:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.