Forum Stats

  • 3,815,571 Users
  • 2,259,051 Discussions
  • 7,893,168 Comments

Discussions

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

Tom Halladay
Tom Halladay Member Posts: 13
edited Nov 23, 2015 5:48AM in ODP.NET

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:

<span class="pln" style="color: #000000;">Value cannot be </span><span class="kwd" style="color: #00008b;">null</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;"> Parameter name</span><span class="pun" style="color: #000000;">:</span><span class="pln" style="color: #000000;"> byteArray</span>

Stack Trace:

<span class="pln" style="color: #000000;">at System</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">BitConverter</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">ToString</span><span class="pun" style="color: #000000;">(</span><span class="pln" style="color: #000000;">Byte</span><span class="pun" style="color: #000000;">[]</span><span class="pln" style="color: #000000;"> value</span><span class="pun" style="color: #000000;">,</span><span class="pln" style="color: #000000;"> Int32 startIndex</span><span class="pun" style="color: #000000;">,</span><span class="pln" style="color: #000000;"> Int32 length</span><span class="pun" style="color: #000000;">)</span><span class="pln" style="color: #000000;"> </span>
<span class="pln" style="color: #000000;">at OracleInternal</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">TTC</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">TTCLob</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">GetLobIdString</span><span class="pun" style="color: #000000;">(</span><span class="pln" style="color: #000000;">Byte</span><span class="pun" style="color: #000000;">[]</span><span class="pln" style="color: #000000;"> lobLocator</span><span class="pun" style="color: #000000;">)</span><span class="pln" style="color: #000000;"> </span>
<span class="pln" style="color: #000000;">at OracleInternal</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">ServiceObjects</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">OracleDataReaderImpl</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">CollectTempLOBsToBeFreed</span><span class="pun" style="color: #000000;">(</span><span class="pln" style="color: #000000;">Int32 rowNumber</span><span class="pun" style="color: #000000;">)</span><span class="pln" style="color: #000000;"> </span>
<span class="pln" style="color: #000000;">at Oracle</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">ManagedDataAccess</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">Client</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">OracleDataReader</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">ProcessAnyTempLOBs</span><span class="pun" style="color: #000000;">(</span><span class="pln" style="color: #000000;">Int32 rowNumber</span><span class="pun" style="color: #000000;">)</span><span class="pln" style="color: #000000;"> </span>
<span class="pln" style="color: #000000;">at Oracle</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">ManagedDataAccess</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">Client</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">OracleDataReader</span><span class="pun" style="color: #000000;">.</span><span class="kwd" style="color: #00008b;">Read</span><span class="pun" style="color: #000000;">()</span><span class="pln" style="color: #000000;"> </span>
<span class="pln" style="color: #000000;">at System</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">Data</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">Entity</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">Core</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">Common</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">Internal</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">Materialization</span><span class="pun" style="color: #000000;">.</span><span class="pln" style="color: #000000;">Shaper</span><span class="pun" style="color: #000000;">`</span><span class="lit" style="color: #800000;">1.</span><span class="pln" style="color: #000000;">StoreRead</span><span class="pun" style="color: #000000;">()</span>

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

Answers

  • Tom Halladay
    Tom Halladay Member Posts: 13
    edited Jun 11, 2015 4:30PM

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

  • Manuel P
    Manuel P Member Posts: 40 Blue Ribbon
    edited Jun 24, 2015 5:02AM

    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
    Alex Keh-Oracle Posts: 3,057 Employee
    edited Jun 24, 2015 12:36PM

    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
    fluxmunki Member Posts: 1
    edited Aug 18, 2015 12:48PM

    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
    Alex Olaf Member Posts: 7
    edited Oct 12, 2015 3:26PM

    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
    yallie Member Posts: 14
    edited Oct 12, 2015 3:26PM
    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 Keh-Oracle Posts: 3,057 Employee
    edited Oct 13, 2015 2:15AM

    Alex,

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

  • yallie
    yallie Member Posts: 14
    edited Oct 13, 2015 11:33AM

    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
    edited Nov 4, 2015 1:14PM

    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
    Alex Olaf Member Posts: 7
    edited Nov 23, 2015 5:48AM

    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) ?

This discussion has been closed.