ContextSwitchDeadlock was detected

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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

.



Relevant Pages

  • Re: Intermittent problem in data transfer MSAccess to Oracle using VB
    ... It retrieves data from a MSAccess database and writes to an Oracle ... Dim LogFileName As String, ff As Long, QueryName As String ... Dim MSAccessConn As String ...
    (microsoft.public.vb.general.discussion)
  • Re: Query Oracle from Excel
    ... You will need the Oracle client sofware installed on the PC you're running ... What exactly is DBDataProvider and DBDataSource? ... Global prmUsername As String ... Dim adoConn As New ADODB.Connection ...
    (microsoft.public.excel.programming)
  • RE: Query Oracle from Excel
    ... Ron, thanks for your help...this is REALLY helping me!!!! ... Now, let's say that Oracle resides on the LAN/WAN somewhere, and I don't ... Global prmUsername As String ... Dim adoConn As New ADODB.Connection ...
    (microsoft.public.excel.programming)
  • Re: Storing time values via jdbc thin driver
    ... In Oracle you don't have just time anyway. ... Java knows Time and Date, ... There is a date data type which has a time ... string or character value. ...
    (comp.databases.oracle.server)
  • Re: Re-logging into An Oracle Database
    ... I've done it in MS SQL but never in Oracle. ... My connection string seems to work, but the app seems to keep the old userid so I can't see the tables I need to see. ... What I prefer to do is use PTQs is to run updates via VBA, something like this. ... 'no error handling included here for this post, but error procs can be included to return a false for this function of the query does not execute. ...
    (comp.databases.ms-access)