|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Started getting "InvalidOperationException was unhandled" since upgrading to .Net 2.0on occassion: "InvalidOperationException was unhandled" followed by "Internal .Net Framework Data Provider error 1." The error happens when I call SqlConnection.Close(), but not all the time. The error can happen over an hour after any activity in my ASP.NET 2.0 application. Here's some info: - I have a timer that is started in Application_Start and every hour performs some house-cleaning duties for my app - I first check to see if SqlConnection.State == ConnectionState.Open before I call Close(), but this doesn't prevent the error. - This has only been happening since upgrading my project to VS 2005 from VS.NET 2003 - On our live server, this is causing a JIT debugging dialog to pop-up asking if I want to debug. AS the source isn't available on the server, this has limited use. - I'm using Sql Server 2005 Anyone know why this is happening? Thanks Ben Ben,
It would be nice to see what kind of information is in a stack of the exception. If you get it on Close, then it is quite possible that connection already closed. Checking of the State property is not a reliable way to check status of the connection because this property does not reflect actual *live* state of the connection, but the state of the connection when it was Open method called. If your application opened connection successfully, then State property will show status connected even if connection was broken later on Show quote "Ben Fidge" <ben.fidge@nospambtopenworld.com> wrote in message news:%23pPpiyNMGHA.3944@tk2msftngp13.phx.gbl... > Since upgrading my project to .Net 2.0 i've been getting the following > error on occassion: > > "InvalidOperationException was unhandled" > > followed by > > "Internal .Net Framework Data Provider error 1." > > The error happens when I call SqlConnection.Close(), but not all the time. > The error can happen over an hour after any activity in my ASP.NET 2.0 > application. > > Here's some info: > > - I have a timer that is started in Application_Start and every hour > performs some house-cleaning duties for my app > - I first check to see if SqlConnection.State == ConnectionState.Open > before I call Close(), but this doesn't prevent the error. > - This has only been happening since upgrading my project to VS 2005 from > VS.NET 2003 > - On our live server, this is causing a JIT debugging dialog to pop-up > asking if I want to debug. AS the source isn't available on the server, > this has limited use. > - I'm using Sql Server 2005 > > Anyone know why this is happening? > > Thanks > > Ben > > > Hi Val,
I'll try and grab the call-stack for you, but remember that it didn't reveal too much anyway. On your advice I've removed the checking of ConnectionState and have replaced it with a try..catch block. Can you suggest a better way? Thanks for your help, Ben Show quote "Val Mazur (MVP)" <group***@hotmail.com> wrote in message news:OYLUpzQMGHA.720@TK2MSFTNGP14.phx.gbl... > Ben, > > It would be nice to see what kind of information is in a stack of the > exception. If you get it on Close, then it is quite possible that > connection already closed. Checking of the State property is not a > reliable way to check status of the connection because this property does > not reflect actual *live* state of the connection, but the state of the > connection when it was Open method called. If your application opened > connection successfully, then State property will show status connected > even if connection was broken later on > > -- > Val Mazur > Microsoft MVP > http://xport.mvps.org > > > "Ben Fidge" <ben.fidge@nospambtopenworld.com> wrote in message > news:%23pPpiyNMGHA.3944@tk2msftngp13.phx.gbl... >> Since upgrading my project to .Net 2.0 i've been getting the following >> error on occassion: >> >> "InvalidOperationException was unhandled" >> >> followed by >> >> "Internal .Net Framework Data Provider error 1." >> >> The error happens when I call SqlConnection.Close(), but not all the >> time. The error can happen over an hour after any activity in my ASP.NET >> 2.0 application. >> >> Here's some info: >> >> - I have a timer that is started in Application_Start and every hour >> performs some house-cleaning duties for my app >> - I first check to see if SqlConnection.State == ConnectionState.Open >> before I call Close(), but this doesn't prevent the error. >> - This has only been happening since upgrading my project to VS 2005 from >> VS.NET 2003 >> - On our live server, this is causing a JIT debugging dialog to pop-up >> asking if I want to debug. AS the source isn't available on the server, >> this has limited use. >> - I'm using Sql Server 2005 >> >> Anyone know why this is happening? >> >> Thanks >> >> Ben >> >> >> > > Hi Ben,
Try .. catch should work Show quote "Ben Fidge" <ben.fidge@nospambtopenworld.com> wrote in message news:OrQwKpTMGHA.3936@TK2MSFTNGP12.phx.gbl... > Hi Val, > > I'll try and grab the call-stack for you, but remember that it didn't > reveal too much anyway. > > On your advice I've removed the checking of ConnectionState and have > replaced it with a try..catch block. Can you suggest a better way? > > Thanks for your help, > > Ben > > > "Val Mazur (MVP)" <group***@hotmail.com> wrote in message > news:OYLUpzQMGHA.720@TK2MSFTNGP14.phx.gbl... >> Ben, >> >> It would be nice to see what kind of information is in a stack of the >> exception. If you get it on Close, then it is quite possible that >> connection already closed. Checking of the State property is not a >> reliable way to check status of the connection because this property does >> not reflect actual *live* state of the connection, but the state of the >> connection when it was Open method called. If your application opened >> connection successfully, then State property will show status connected >> even if connection was broken later on >> >> -- >> Val Mazur >> Microsoft MVP >> http://xport.mvps.org >> >> >> "Ben Fidge" <ben.fidge@nospambtopenworld.com> wrote in message >> news:%23pPpiyNMGHA.3944@tk2msftngp13.phx.gbl... >>> Since upgrading my project to .Net 2.0 i've been getting the following >>> error on occassion: >>> >>> "InvalidOperationException was unhandled" >>> >>> followed by >>> >>> "Internal .Net Framework Data Provider error 1." >>> >>> The error happens when I call SqlConnection.Close(), but not all the >>> time. The error can happen over an hour after any activity in my ASP.NET >>> 2.0 application. >>> >>> Here's some info: >>> >>> - I have a timer that is started in Application_Start and every hour >>> performs some house-cleaning duties for my app >>> - I first check to see if SqlConnection.State == ConnectionState.Open >>> before I call Close(), but this doesn't prevent the error. >>> - This has only been happening since upgrading my project to VS 2005 >>> from VS.NET 2003 >>> - On our live server, this is causing a JIT debugging dialog to pop-up >>> asking if I want to debug. AS the source isn't available on the server, >>> this has limited use. >>> - I'm using Sql Server 2005 >>> >>> Anyone know why this is happening? >>> >>> Thanks >>> >>> Ben >>> >>> >>> >> >> > > |
|||||||||||||||||||||||