Unexpected Packet received in Oracle.ManagedDataAccessCore (2.19.80) — oracle-tech

    Forum Stats

  • 3,708,688 Users
  • 2,241,109 Discussions
  • 7,840,539 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Unexpected Packet received in Oracle.ManagedDataAccessCore (2.19.80)

42523264252326 Posts: 7
edited August 2020 in ODP.NET

Envrioment

  • Platform: .NET Core 3.1 Console Application
  • Oracle Nuget: Oracle.ManagedDataAccessCore (2.19.80)

Steps

  1. Create a table with a DateTime column named "CreateDate".
  2. Execute the following query:
select(        CASE            WHEN 1 = 0 THEN a."CreateDate"            ELSE NULL        END    ) as C0from    "YourTableName" a

Exception

System.Exception: 'TTCExecuteSql:ReceiveExecuteResponse - Unexpected Packet received.'This exception was originally thrown at this call stack:    OracleInternal.TTC.TTCExecuteSql.ReceiveExecuteResponse(ref OracleInternal.TTC.Accessors.Accessor[], OracleInternal.TTC.Accessors.Accessor[], bool, ref OracleInternal.Common.SQLMetaData, OracleInternal.Common.SqlStatementType, long, int, out int, ref long, int, long, long[], bool, int, ref OracleInternal.ServiceObjects.DataUnmarshaller, ref OracleInternal.TTC.TTCExecuteSql.MarshalBindParameterValueHelper, out long[], bool, ref bool, ref System.Collections.Generic.List<OracleInternal.TTC.Accessors.TTCResultSet>, bool)    OracleInternal.ServiceObjects.OracleDataReaderImpl.FetchMoreRows(int, bool, bool)    Oracle.ManagedDataAccess.Client.OracleDataReader.Read()    System.Data.Common.DataAdapter.FillLoadDataRow(System.Data.ProviderBase.SchemaMapping)    System.Data.Common.DataAdapter.FillFromReader(System.Data.DataSet, System.Data.DataTable, string, System.Data.ProviderBase.DataReaderContainer, int, int, System.Data.DataColumn, object)    System.Data.Common.DataAdapter.Fill(System.Data.DataTable[], System.Data.IDataReader, int, int)    Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(System.Data.DataTable[], int, int, System.Data.IDbCommand, System.Data.CommandBehavior)    System.Data.Common.DbDataAdapter.Fill(System.Data.DataTable)    OracleTest.Program.Main(string[]) in Program.cs

Example

    class Program    {        static void Main(string[] args)        {            var connectionStr = @YOUR CONNECTION STRING;            var oracleConnection = new OracleConnection(connectionStr);            oracleConnection.Open();            var sql = $"select(CASE WHEN 1 = 0 THEN a.\"Date\" ELSE NULL END) as C0 from \"YOUR TABLE NAME\" a ";            using (var command = oracleConnection.CreateCommand())            {                command.CommandText = sql;                DataTable dataTable = new DataTable();                using (var adapter = new OracleDataAdapter())                {                    adapter.SelectCommand = command;                    adapter.Fill(dataTable);                }            }        }    }
4252326

Best Answer

  • Alex Keh-OracleAlex Keh-Oracle Posts: 2,720 Employee
    edited August 2020 Accepted Answer

    The bug has been fixed in our main code line. My expectation is that the fix will be in the ODP.NET Core 19.10 release.

    4252326

Answers

  • Alex Keh-OracleAlex Keh-Oracle Posts: 2,720 Employee
    edited July 2020

    I tried your C# app with a table using a DATE column and TIMESTAMP column. In both cases with either ODP.NET Core 2.19.80 or 2.19.70, I didn't hit an error. I used DB 19c. Which DB version did you use?

  • 42523264252326 Posts: 7
    edited July 2020

    I found out that there must be at least one record in the table. For example:

    Table Design:

    Name
    Type
    Size
    IDNumber0
    DateDATE7
    TimeTIMESTAMP0
    Time2INTERVAL DAY TO SECOND0

    Table Data:

    ID
    DateTimeTime2
    1(Null)(Null)(Null)

    Then replace the [column] in the sql below:

    var sql = $"select(CASE WHEN 1 = 0 THEN a.\"[column]\" ELSE NULL END) as C0 from \"YOUR TABLE NAME\" a ";

     

    [Date]: reproduced

    [Time]: can't reproduce

    [Time2]: reproduced

    DB version: 11/12/18/19c

  • Alex Keh-OracleAlex Keh-Oracle Posts: 2,720 Employee
    edited July 2020

    I added the interval column and added one row of data, but still can't reproduce the problem with the 2.19.80 version against the data or interval column. Do you want to send us your trace? Just add these two lines and run your app.

    OracleConfiguration.TraceFileLocation = @D:\traces;

    OracleConfiguration.TraceLevel = 7;

    You can send the trace file to dotnet_us (at) oracle.com.

  • 42523264252326 Posts: 7
    edited August 2020

    Thank you. The email has been sent. I hope it's useful to you.

  • Alex Keh-OracleAlex Keh-Oracle Posts: 2,720 Employee
    edited August 2020

    This bug appears to be the same as Bug 26123054.

  • 42523264252326 Posts: 7
    edited August 2020

    Will this problem be fixed recently?

  • Alex Keh-OracleAlex Keh-Oracle Posts: 2,720 Employee
    edited August 2020

    The bug hasn't been fixed yet. We're still evaluating the root cause.

    4252326
  • Alex Keh-OracleAlex Keh-Oracle Posts: 2,720 Employee
    edited August 2020 Accepted Answer

    The bug has been fixed in our main code line. My expectation is that the fix will be in the ODP.NET Core 19.10 release.

    4252326
Sign In or Register to comment.