CURSORS ?????

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
expas
Posts: 14
Joined: Wed 11 May 2005 00:09

CURSORS ?????

Post by expas » Tue 23 Aug 2005 21:51

i already post this bug (you fix blob and number but what about cursors?)

we test last version and find that CURSORS DONT CLOSE!!!!!!!!!!!!

SQL code:

Code: Select all

create or replace package mypkg
is
type refCur is ref cursor;
end mypkg;

create or replace procedure test_close_of_cursor
(
cur out mypkg.refCur
)
is
begin
	open cur for
		select * from dual;
end test_close_of_cursor;
C# code:

Code: Select all

//закрытие курсоров
for (int i=0; i<1000; i++)
{
using(OracleCommand cmd = new OracleCommand("test_close_of_cursor", (OracleConnection)_cnn))
{
cmd.CommandType = CommandType.StoredProcedure;
OracleParameter p = new OracleParameter("cur", OracleDbType.Cursor);
p.Direction = ParameterDirection.Output;
cmd.Parameters.Add(p);
using (OracleDataReader reader = cmd.ExecuteReader())
{
}
}
}
it generate error ORA-01000 and ORA-06512

pls, answer, do you plan to fix this? or may be need to write some specific code to close corsor?

expas
Posts: 14
Joined: Wed 11 May 2005 00:09

Post by expas » Thu 25 Aug 2005 00:53

if add call GC.Collect() - cursor close (but it slowing code)

so in destructor you close cursor, but dont close it in Dispose

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Mon 29 Aug 2005 08:34

OraDirect .NET does not know where you want to use returned Cursor parameter.
You must call ((OracleCursor)p.OracleValue).Dispose(); in your code.

expas
Posts: 14
Joined: Wed 11 May 2005 00:09

Post by expas » Wed 07 Sep 2005 23:25

thx

Post Reply