Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Bug in Managed ODP.NET 4.121.2.0 + EF 6: CLOB data values sometimes breaks reader's ability to proc

Tom HalladayFeb 19 2015 — edited Nov 23 2015

I've been seeing this problem crop up since the 12g client force-upgraded the Oracle.ManagedDataAccess dll's in my GAC.

I originally posted the error on StackOverflow, thinking that it was a configuration problem on my side:

oracle - EF + ODP.NET + CLOB = Value Cannot be Null - Parameter name: byteArray? - Stack Overflow

Error:

Value cannot be null. Parameter name: byteArray

Stack Trace:

at System.BitConverter.ToString(Byte[] value, Int32 startIndex, Int32 length)

at OracleInternal.TTC.TTCLob.GetLobIdString(Byte[] lobLocator)

at OracleInternal.ServiceObjects.OracleDataReaderImpl.CollectTempLOBsToBeFreed(Int32 rowNumber)

at Oracle.ManagedDataAccess.Client.OracleDataReader.ProcessAnyTempLOBs(Int32 rowNumber)

at Oracle.ManagedDataAccess.Client.OracleDataReader.Read()

at System.Data.Entity.Core.Common.Internal.Materialization.Shaper`1.StoreRead()

However I can now confirm that this is definitely a bug in the Oracle code, as it seems to only happen under a very specific set of conditions:

Multiple Objects (Rows) are selected

Multiple Properties (Columns) are selected

AND

The data returned has a mix of null and non-null CLOB values.  All null or all non-null does not seem to trigger the problem.

This is a HUGE problem for us as our applications are all written against ODP.NET, and utilize CLOBS.  Has anyone else had this problem?

Any advice at this point other then 'don't use clobs' would be greatly appreciated.

Thanks

Comments

Tom Halladay

It's been 5 months & 350+ views.  No acknowledgement of this problem or indication of a planned fix?

Manuel P

Did you try the new version of the managed driver? It's available on NuGet: https://www.nuget.org/packages/Oracle.ManagedDataAccess

If you can still reproduce a bug with that version, I suggest to create a small sample and submit it as an Oracle Service Request.

If you don't have access to official Oracle Support, at least upload the sample here. With a sample it is much more likely that someone from Oracle creates a bug entry.

Alex Keh-Oracle

Bug 20071960 sounds pretty similar to the problem you've been experiencing. There's a fix already out for it. You can use the latest ODP.NET NuGet release to get access to the fix.

If you still experience the problem after upgrading to the latest ODP.NET release, this is a new issue. Please provide a test case or open a service request as the previous poster suggested. It's hard to debug a new problem without more details on what could be the root cause.

fluxmunki

I've encountered this issue, it seems to only occur with fairly specific versions of Oracle.ManagedDataAccess.dll.

Product Versions:

  • 4.121.2.20140731 - Has the issue
  • 4.121.2.20141216 ODAC RELEASE 3 - Does not have the issue

Unfortunately 4.121.2.20140731 is the version that ends up in the GAC if you install "Oracle Database 12c Release 1 (12.1.0.2.0)" (not sure if it's every version of this 'version', but definitely the one I installed). Now because the Assembly Version of the dll is the same in all the different versions of the dll (4.121.2.0) the one in the GAC is favoured over any local dll I put in my applications bin directory. My installer did put a working version in the bin directory, but writing this has just made me think that the installer could replace the version in the GAC, which will hopefully fix the issue for me!

Alex Olaf

Updated the project to latest nuget dersion 4.121.2.20150515 and still hitting the bug. Reproducable on x86 only. Havn't hit it on x64.

yallie

Product Versions:

  • 4.121.2.20140731 - Has the issue
  • 4.121.2.20141216 ODAC RELEASE 3 - Does not have the issue

We still have this same issue with a newer version: 4.121.2.20150515:

Exception type: ArgumentNullException

Parameter name: byteArray

Server stack trace:

   в System.BitConverter.ToString(Byte[] value, Int32 startIndex, Int32 length)

   в OracleInternal.TTC.TTCLob.GetLobIdString(Byte[] lobLocator)

   в OracleInternal.ServiceObjects.OracleDataReaderImpl.CollectTempLOBsToBeFreed(Int32 rowNumber)

   в Oracle.ManagedDataAccess.Client.OracleDataReader.ProcessAnyTempLOBs(Int32 rowNumber)

   в Oracle.ManagedDataAccess.Client.OracleDataReader.Read()

Regards, Alex.

Alex Keh-Oracle

Alex,

Can you upload a test case to this thread so that the Oracle team can investigate this bug?

yallie

Hi Alex,

Can you upload a test case to this thread so that the Oracle team can investigate this bug?

Unfortunately, I haven't managed to reproduce the bug on my development machine, so I don't have a test case for it.

Today we updated to ODAC release 4 (4.121.2.20150926), and the bug seems to be gone on all machines.

Can I have a look at the full changelog for the managed ODP.NET driver? I'm not sure if the bug is fixed indeed...


Thanks, Alex.

c35bb015-5cc6-4ce0-82cf-e5dcabe2e2db

I can reproduce the error as follows:

Multiple records in the database. Some have CLOB data and others are NULL.

The following code throws an exception executing a select statement:

using (DataTable loDT = new DataTable())

                    {

                        loDT.Load(loCmd.ExecuteReader());

Work around: Use a dataset and fill the datatable using a DataAdapter.

Alex Olaf

We've reproduced the bug on a virtual machine. We can give you the image so you can investigate it.

Unfortunately, I can't provide you the source file of our project so far, but belive it's not necessary.

Will you try to dig into on VirtualBox image (14Gb) ?

1 - 10
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 21 2015
Added on Feb 19 2015
10 comments
6,831 views