ContextSwitchDeadlock was detected
- From: v.maggs@xxxxxxxxxxx
- Date: 11 Aug 2006 12:01:54 -0700
Folks,
I am connecting to an Oracle 8.1.7.4.1 database and executing a
stored procedure, Change_Results. The code works great but soon after
my VB2005 app starts, I get this message:
ContextSwitchDeadlock was detected.
Message: The CLR has been unable to transition from COM context
0x190110 to COM context 0x190260 for 60 seconds. The thread that owns
the destination context/apartment is most likely either doing a non
pumping wait or processing a very long running operation without
pumping Windows messages. This situation generally has a negative
performance impact and may even lead to the application becoming non
responsive or memory usage accumulating continually over time. To avoid
this problem, all single threaded apartment (STA) threads should use
pumping wait primitives (such as CoWaitForMultipleHandles) and
routinely pump messages during long running operations.
Following is my code. As I said, it works perfectly. I just do not know
what in the ham sandwich I am supposed to do about this warning.
Public Function Change_Result(ByVal RsltID As String, _
ByVal New_Value As String, _
ByVal Stat As Long, _
ByVal Change_Reason As String, _
ByVal Rslt_Origin As String) As Long
Change_Result = -1
Try
Using cnLims As New OracleConnection
cnLims.ConnectionString = GetLimsConnectString() _
& "User ID=" & Form1.txtUserID.Text _
& ";Password=" & Form1.txtPassword.Text
cnLims.Open()
Dim command As OracleCommand = cnLims.CreateCommand()
command.CommandText = "NAIP_Result_API.Change_Result"
command.CommandType = CommandType.StoredProcedure
command.Parameters.Add(New OracleParameter("Rslt_Id",
OracleType.Number)).Value = RsltID
command.Parameters("Rslt_ID").Direction =
ParameterDirection.Input
command.Parameters.Add(New OracleParameter("New_Value",
OracleType.VarChar)).Value = New_Value
command.Parameters("New_Value").Direction =
ParameterDirection.Input
command.Parameters.Add(New OracleParameter("Stat",
OracleType.Number)).Value = Stat
command.Parameters("Stat").Direction =
ParameterDirection.InputOutput
command.Parameters.Add(New
OracleParameter("Change_Reason", OracleType.VarChar)).Value =
Change_Reason
command.Parameters("Change_Reason").Direction =
ParameterDirection.Input
command.Parameters.Add(New
OracleParameter("Rslt_Origin", OracleType.VarChar)).Value = Rslt_Origin
command.Parameters("Rslt_Origin").Direction =
ParameterDirection.Input
command.ExecuteNonQuery()
Change_Result = command.Parameters("Stat").Value
command.Dispose()
End Using
My.Application.Log.WriteEntry("NAIP_Result_API.Change_Result Return
Status: " & Change_Result & " (0 = SUCCESS)" & vbCrLf)
Catch ex As OracleException
Throw ex
Catch ex As Exception
Throw ex
End Try
Return Change_Result
End Function
Thanks,
Vint
.
- Prev by Date: Re: ASP.NET with Datasets
- Next by Date: Executing query with group by and aggregate on a dataset
- Previous by thread: Using Strongly Typed Datasets
- Next by thread: Executing query with group by and aggregate on a dataset
- Index(es):
Relevant Pages
|