Devart dotConnect IndexOutOfRangeException

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
yunli_ss
Posts: 2
Joined: Wed 20 Aug 2014 07:15

Devart dotConnect IndexOutOfRangeException

Post by yunli_ss » Wed 20 Aug 2014 07:36

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.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Devart dotConnect IndexOutOfRangeException

Post by Pinturiccio » Fri 22 Aug 2014 12:49

We have reproduced the issue. We will investigate it and post here about the results as soon as possible.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Devart dotConnect IndexOutOfRangeException

Post by Pinturiccio » Wed 03 Sep 2014 12:27

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.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Devart dotConnect IndexOutOfRangeException

Post by Pinturiccio » Thu 04 Sep 2014 14:18

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

yunli_ss
Posts: 2
Joined: Wed 20 Aug 2014 07:15

Re: Devart dotConnect IndexOutOfRangeException

Post by yunli_ss » Tue 09 Sep 2014 02:31

Thanks!

Post Reply