Hey all when i use TOAD to update a table all works just fine when using this query:
Update CSR.CSR_EAI_SOURCE ces
Set (STATUS_CODE, COMPLETE_DATE, DATA) =
(SELECT 'ERROR', '', REPLACE(REPLACE(c.Data, '…', ' '), '’','''')
FROM CSR.CSR_EAI_SOURCE C
WHERE c.EID = ces.EID
AND c.STATUS_CODE = 'ERROR')
WHERE EXISTS (SELECT 1
FROM CSR.CSR_EAI_SOURCE C
WHERE c.EID = ces.EID
AND c.STATUS_CODE = 'ERROR');
However, once i try doing the same thing in my VB.net program using this code:
Dim OracleCommand As New OracleCommand()
Dim ra As Integer
OracleCommand = New OracleCommand("UPDATE CSR.CSR_EAI_SOURCE ces " & _
"SET (STATUS_CODE, COMPLETE_DATE, DATA) = " & _
"(SELECT 'ERROR', '', REPLACE(REPLACE(c.Data, '…', ' ' ), '’','''') " & _
"FROM CSR.CSR_EAI_SOURCE C " & _
"WHERE (c.EID = ces.EID) " & _
"AND c.STATUS_CODE = 'ERROR') " & _
"WHERE EXISTS (SELECT 1 " & _
"FROM CSR.CSR_EAI_SOURCE C " & _
"WHERE (c.EID = ces.EID) " & _
"AND c.STATUS_CODE = 'ERROR')", OracleConnection)
Try
ra = OracleCommand.ExecuteNonQuery()
OracleConnection.Close()
MsgBox("done")
Catch ex As Exception
MsgBox("ERROR: " & Err.Description & " " & Err.Number)
OracleConnection.Close()
End Try
It stays on the ra = OracleCommand.ExecuteNonQuery() continuously until i get the error
The CLR has been unable to transition from COM context 0x3327fa8 to COM context 0x3328118 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.
What could i do in order to get this working within VB.net since it works just fine in TOAD when running that same query?
Thanks!
David
you can also turn off that ContextSwitchDeadlock was detected exception:
from http://dotnetdud.blogspot.com/2009/01/clr-has-been-unable-to-transition-from.html
EDIT:Check for Locks
do note you will need ability to see dba_objects as well as v$locked_object (pulled this from here)
and check out this article
http://www.orafaq.com/node/854