2
Answers

Invalid operation. Connection is closed.

Muhammad Gukhool

Muhammad Gukhool

14y
19.7k
1

Hello,
I have 3tier web application which is being used by different departments and installed on different server. Everyday i get error message "Invalid operation. Connection is closed". We tried to alter the code and we used the keywords "using" when calling a procedure, despite this the error still continue to occur.
Can someone please HELP to solve out this issue????
I am using Oracle Client 9.2 and ASP.Net 2.0 C# language, the web application is hosted on a Windows Server 2003 machine
On a server where only 3 users may access the application at a time, the error did not occur at all, while on the other server around 15 users can be accessing the web application simultaneously and hence using only one oracle session. The error keep occuring nearly every minutes.
Users access the web application on a thin client and then all others login on a remote server and then access the application found on another windows server.
Please find a piece of code below:
public static DocInfo Doc(string docid)
{

DB db = null;
DocInfo docObject = new DocInfo();
try
{

using (db = DBFactory.GetDB())
{
 

using (OracleDataReader dr = db.Query(
DocProcessingDAC.GetFileForAdmin,
new NameValuePair("p_doc_id", doc_id)
))
{
 
if (dr != null)
{
while (dr.Read())
{
scanDocInfo =
new ScanDocInfo(dr);
scanDocInfo.SpecialInstructionInfoCol = getDocInstructions(db, scanDocInfo.DocId);
}
}
}

}
return docObject;
}
catch (Exception e)
{
ExceptionHandler.Handle(e, "web application", "getting file");
return docObject;
}

}

Answers (2)