Improving bank connection problem with Visual Studio

1

Hello, does anyone know if I have any way to find problematic code in C # related to opening and closing database connections? I have an application that after a few hours processing a load while executing a select generates an idle time error (ORA-02396)

But looking at the structures I could not identify problem in the code in the line where the error is reported:

using (OracleConnection con = new OracleConnection(banco))
        {
            using (OracleCommand cmd = new OracleCommand())
            {
                cmd.Connection = con;
                cmd.CommandTimeout = 500;
                cmd.CommandText = sql;
                foreach (OracleParameter op in parametros)
                {
                    cmd.Parameters.Add(op);
                }

                con.Open();
                DataTable tabela = new DataTable();
                using (OracleDataReader odr = cmd.ExecuteReader())
                {
                    tabela.Load(odr);
                }

                return tabela;
            }
        }

When executing a query in the database to capture the user_resource_limit, Oracle's IDLE_TIME was at 30. The problem is that I need to find a solution in the code for the problem without having to request to change this parameter. I wanted to know if there is a kind of native Visual Studio 2012 profiler to help find "leak" points.

    
asked by anonymous 18.10.2016 / 22:02

1 answer

1

VS 2012 has a native profile: link

With it you can analyze performance chart, cost of the method runs, among other metrics.

You'll need this VS 2012 patch to be able to analyze the generated reports: link

    
18.10.2016 / 22:05