getting ora 03113 end-of-file on communication channel while using Execute.Reader()

guptashikha12

New member
Joined
May 24, 2011
Messages
1
Programming Experience
1-3
Hi

I need to call a piece of code again after a connection failure , below is my code

Dim sqlstr As String
Dim cnt As Integer = 0
Dim cnt1 As Integer = 0
Dim sleep_split As UInt64 = 0
Dim loop_cnt As Integer = 0
dbhb= New OracleConnection(odbcNG)
Dim dr As OracleDataReader
Dim cmd As New OracleCommand

jump_here:
Try
If dbhb.State <> 1 Then
dbhb.Open()
End If
Catch
MsgBox("Unable to connect to database......Exiting ")
Exit Sub
End Try
cmd.Connection = dbhb
While (true)
exit_flg = 0
sqlstr = "select coulmn1 from table1"
cmd.CommandText = sqlstr
cmd.CommandType = CommandType.Text
Try
dr = cmd.ExecuteReader()
If dr.Read Then
cnt1 = dr.GetValue(0)
Else
MsgBox("Please populate data ......Exiting")
Exit Sub
End If
dr.Close()
sqlstr = "SELECT column1, column2 from table1"
cmd.CommandText = sqlstr
dr = cmd.ExecuteReader
If dr.Read Then
cnt2 = dr.GetValue(0)
cnt3 = dr.GetValue(1)
Else
MsgBox("Please populate the service.....Exiting ")
Exit Sub
End If
dr.Close()
sqlstr = "update table set column1 = 'sdsad''"
cmd.CommandText = sqlstr
cnt = cmd.ExecuteNonQuery()
Catch
loop_cnt = loop_cnt + 1
If loop_cnt < 10 Then
Sleep(100)
dr.Close()
dr.Dispose()
cmd.Connection.Close()
cmd.Dispose()
If dbhb.State = 1 Then
dbhb.Close()
End If
GoTo jump_here
End If
MsgBox("Error.....EXITING TOOL")

exit_flg = 1
Exit Sub
End Try

End While

when first time connection failure occurs, with the help of goto i m trying again to connect, but while trying again i am getting error ora: 03113 end-of-file on communication channel in the line shown in above code in bold.

plz reply
thanks
 
Back
Top