Page 1 of 1

Devart dotConnect IndexOutOfRangeException

Posted: Wed 20 Aug 2014 07:36
by yunli_ss
I am using dotConnect for Oracle to access the Oracle database.
I encounter an ‘IndexOutOfRangeException’ error when I use it, the error happens while multi-threads read object type together.

Here is the environment:
the Devart.Data version is 5.0.983.0
the Devart.Data.Oracle version is 8.4.191.0
the Oracle Server version is 11.2.0.4.0
the Oracle Client version is 11.2.0.1.0

Table in Oracle like this:
CREATE OR REPLACE TYPE objectself as object
(
mv number,
mc char(3),
order member function match(m objectself) return integer
)
/
CREATE OR REPLACE TYPE BODY objectself AS
ORDER MEMBER FUNCTION match(m objectself) RETURN INTEGER IS
BEGIN
IF mv < m.mv THEN
RETURN -1;
ELSIF mv > m.mv THEN
RETURN 1;
ELSE
RETURN 0;
END IF;
END;
END;
/
create table ObjectTable
(
PK_ID number(9),
ObjectValue objectself
)
/
declare
l_tem number(9);
BEGIN
FOR i IN 1..1000 LOOP
l_tem := i;
insert into ObjectTable (PK_ID,ObjectValue) values (l_tem,objectself(l_tem,'ABC'));
END LOOP;
END;
/

Multi-Thread read ObjectTable and each thread runs code like this:
OracleConnection con = new OracleConnection(CONNECTIONSTR);
con.Open();
OracleCommand cmd = con.CreateCommand();
cmd.CommandText = "select * from ObjectTable";
OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow);
while (reader.Read())
{
var obj = reader.GetOracleObject(1);
}
reader.Close();

There are about 100 threads executing it at the same time.

Here is the error call stack:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Devart.Data.Oracle.OracleObject.a(OracleAttribute A_0, Boolean A_1)
at Devart.Data.Oracle.OracleObject.a(Object A_0, OracleAttribute A_1)
at Devart.Data.Oracle.OracleObject.set_IsNull(Boolean value)
at Devart.Data.Oracle.OracleObject.Devart.Data.Oracle.ICustomOracleObject.FromOracleObject(NativeOracleObject oraObject)
at Devart.Data.Oracle.OracleObject.a(b8 A_0, OracleConnection A_1, Boolean A_2)
at Devart.Data.Oracle.OracleDataReader.GetOracleObject(Int32 i)

If you can help me or give me proposal to solve the problem, I will be very appreciated.

Re: Devart dotConnect IndexOutOfRangeException

Posted: Fri 22 Aug 2014 12:49
by Pinturiccio
We have reproduced the issue. We will investigate it and post here about the results as soon as possible.

Re: Devart dotConnect IndexOutOfRangeException

Posted: Wed 03 Sep 2014 12:27
by Pinturiccio
We have fixed the bug with throwing the "Index was outside the bounds of the array" exception when working with OracleObjects in multithreaded mode. We will post here when the corresponding build of dotConnect for Oracle is available for download.

Re: Devart dotConnect IndexOutOfRangeException

Posted: Thu 04 Sep 2014 14:18
by Pinturiccio
New build of dotConnect for Oracle 8.4.239 is available for download!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?t=30327

Re: Devart dotConnect IndexOutOfRangeException

Posted: Tue 09 Sep 2014 02:31
by yunli_ss
Thanks!