6 Replies Latest reply on Dec 2, 2016 2:10 PM by MateuszH

    CLOB and null bug

    Alex Olaf

      There are a bug with stack trace

      Value cannot be null.
      Parameter name: byteArray

      Server 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()

       

      Reproducable on latest nuget package (28 apr 2016)

      I cannot provide you an example, but you can download virtual machine image from here 2С :: Скачать

      The bug exists for many years, dudes...

        • 1. Re: CLOB and null bug
          Alex Olaf

          We were able to reproduce the bug on a smaller example and dataset.

          using System; using System.Configuration; using System.Data; using BLToolkit; using BLToolkit.Data; using BLToolkit.Data.DataProvider; using BLToolkit.Data.Linq; struct Program {   static string ConnectionString { get { return ConfigurationManager.AppSettings["conn-string"]; } } static string UserLogin { get { return ConfigurationManager.AppSettings["user-login"]; } } static string AppServerID { get { return ConfigurationManager.AppSettings["app-server"]; } } static void Main() { var dataProviderName = OdpManagedDataProvider.NameString; DbManager.AddDataProvider(dataProviderName, new OdpManagedDataProvider()); DbManager.AddConnectionString(dataProviderName, string.Empty, ConnectionString); using (var db = new DbManager()) { using (var reader = db.SetCommand(@" SELECT    t1.caption as Caption,    t1.IS_INITIAL as IsInitial,    t1.DEV_COMMENT as DevComments,    t1.ID    FROM    test11 t1 ").ExecuteReader()) { var counter = 0; while (reader.Read()) { var id = reader["ID"]; var caption = reader["CAPTION"]; var devComments = reader["DevComments"]; if (devComments is DBNull) { devComments = "(null)"; } Console.WriteLine($"{counter++}: {id} - {caption} - {devComments}"); } } } } }

          the dataset contains 300+ rows and we can't reproduce on a smaller set. I belive we can prepare a virtualbox image with oracle installed and the dataset, cause bug isn't reproducible on any machine.

          • 2. Re: CLOB and null bug
            Alex Olaf

            Do any updates on this bug?

            What else can we do to help you fix it ?

            What about opensource ODP.NET so we can fix it ourself ?

            • 3. Re: CLOB and null bug
              993843

              The cause of this problem has been identified in:

              Bug 20195642 - MANAGED ODP FAILS WITH ERROR - VALUE CANNOT BE NULL

              Closed as duplicate of

               

              Bug 19791495 - ODPM: NULLREFEXCEPTION WHEN SELECTING LOB COLUMN

               

              Also the fix is included in ODAC 12c Release 4:

              http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html

               

              Thanks,

              Pavan

              • 4. Re: CLOB and null bug
                MateuszH

                HI,

                 

                Check does exists in your solution some old version of Oracle.ManagedDataAccess...

                 

                Best regards,

                M.

                • 5. Re: CLOB and null bug
                  user8609285

                  Hi, I am experiencing exactly the same issue using the latest version of Oracle.ManagedDataAccess from 2016-09-17, which I obtained via nuget.

                   

                  Is the fix you mentioned in ODAC 12c Release 4 also available via nuget?

                  • 6. Re: CLOB and null bug
                    MateuszH

                    according following document, you should install

                    ODAC 12c Release 4 and Oracle Developer Tools for Visual Studio (12.1.0.2.4)

                    from

                    Oracle Data Access Components (ODAC) for Windows Downloads

                    MANAGED ODP FAILS WITH ERROR - VALUE CANNOT BE NULL (Doc ID 1960528.1)