Does ODP.net close cursor cursor when closing connection?

I have not been able to find this explicitly yet, but a bunch of examples that I found on the Internet follow what I did.

I have a C # class that uses ODP.net to connect to Oracle DB and runs a procedure that is in the package.

My package has stored procedures that accept the ref cursor parameter. The whole procedure opens the cursor for a specific select statement.

If I performed this procedure directly on db oracle, then in the end I will click the maximum number of errors of open cursors.

So, I was wondering if ODP.net really closes this cursor that was open in my procedure?

I am using the OracleDataApaper.Fill (DataSet) method.

eg.

DataSet ds = new DataSet();
OracleConnection conn = new OracleConnection(this.connStr);
OracleCommand com = new OracleCommand("MYPKG.MYQUERY", conn);
OracleDataAdapter adapter = new OracleDataAdapter(com);
conn.Open();
com.Parameters.Add("searchParam", OracleDbType.Varchar2).Value = "myName";
com.Parameters.Add("outCursor", OracleDbType.RefCursor, ParameterDirection.Output);
com.CommandType = CommandType.StoredProcedure;

adapter.Fill(ds);
conn.Close();




PROCEDURE GETALLEMAILS(searchParamIN VARCHAR2, outCursor OUT sys_refcursor) AS
  BEGIN
    open outCursor
      select 
        EAEMAL as Email
      from 
        EmailTable
      where 
        EmailName = searchParam;  
  END GETALLEMAILS;

. - , !


:

.

com.Dispose();
conn.Close();
conn.Dispose();

.

, , OracleDataAdapter.Fill(Dataset) ref , Fill().
http://www.frontoracle.com/oracle-archive/140/386140-close-ref-cursor.html

, Oracle .

+5
2

ODP.NET , . , :

  • OracleParameter, (!), Odp.net .
  • OracleCommand,
  • , odp.net , ( ), ( , , ).

I.o.w: , .

OracleDataAdapter , ( odp.net , () , . thumb odp.net: , dispose, : , , , , .

+9

, , , , , ODP.Net: , () . , , , / ODP, , .

0

All Articles