ExecuteNonQuery got struck without throwing any exception

65 Views Asked by At

My procedure got struck after executing ExecuteNonQuery.But in backend the procedure is working fine. nearly 10481134 records inserted into a table.It takes more than 20 mins time. After executing the procedure, my code is still running. bt for less records, backend and frontend also working fine(once the procedure completes its execution it gets stopped and comes to frontend).can anyone solve my issue?

public int FunRunRPTJob()
    {
        int iret = 0;
        try
        {
            if (JobStatus == "Y")
            {
                using (OracleConnection oracon = new OracleConnection(con))
                {
                    using (OracleCommand ocmd = new OracleCommand("SP_ADDRESS_DETAILS", oracon))
                    {
                        ocmd.CommandType = CommandType.StoredProcedure;
                        ocmd.CommandTimeout = 0;
                        ocmd.Parameters.Add("P_RESULT", OracleType.Number);
                        ocmd.Parameters["P_RESULT"].Direction = ParameterDirection.Output;
                        oracon.Open();
                        try
                        {
                            iret = ocmd.ExecuteNonQuery;
                        }
                        catch (Exception ex)
                        {
                            iret = -1;
                            ObjMail.SendEmail("Error While address details Job Run", ex.ToString());
                        }
                        oracon.Close();
                    }
                }
            }

        }
        catch (Exception ex)
        {
            iret = -1;
            ObjMail.SendEmail("Error While address details Job Run", ex.ToString());
        }
        finally
        {
            //oracon.Close();
        }
        return iret;

    }
0

There are 0 best solutions below