Skip to content

Instantly share code, notes, and snippets.

@doggy8088
Last active May 12, 2020 05:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doggy8088/0f8286cc8ec082a03708af5b90db5350 to your computer and use it in GitHub Desktop.
Save doggy8088/0f8286cc8ec082a03708af5b90db5350 to your computer and use it in GitHub Desktop.
Oracle.EntityFrameworkCore & Oracle.ManagedDataAccess.Core NuGet package release notes

下載 Release Notes 的方式

$version = '2.19.70'
nuget.exe install Oracle.EntityFrameworkCore -Version $version -OutputDirectory out
code out\Oracle.EntityFrameworkCore.$version\readme.txt

nuget.exe install Oracle.ManagedDataAccess.Core -Version $version -OutputDirectory out
code out\Oracle.ManagedDataAccess.Core.$version\readme.txt
$version = '2.19.60'
nuget.exe install Oracle.EntityFrameworkCore -Version $version -OutputDirectory out
code out\Oracle.EntityFrameworkCore.$version\readme.txt

nuget.exe install Oracle.ManagedDataAccess.Core -Version $version -OutputDirectory out
code out\Oracle.ManagedDataAccess.Core.$version\readme.txt
$version = '2.19.50'
nuget.exe install Oracle.EntityFrameworkCore -Version $version -OutputDirectory out
code out\Oracle.EntityFrameworkCore.$version\readme.txt

nuget.exe install Oracle.ManagedDataAccess.Core -Version $version -OutputDirectory out
code out\Oracle.ManagedDataAccess.Core.$version\readme.txt
$version = '2.19.30'
nuget.exe install Oracle.EntityFrameworkCore -Version $version -OutputDirectory out
code out\Oracle.EntityFrameworkCore.$version\readme.txt

$version = '2.19.31'
nuget.exe install Oracle.ManagedDataAccess.Core -Version $version -OutputDirectory out
code out\Oracle.ManagedDataAccess.Core.$version\readme.txt
$version = '2.19.3'
nuget.exe install Oracle.ManagedDataAccess.Core -Version $version -OutputDirectory out
code out\Oracle.ManagedDataAccess.Core.$version\readme.txt
$version = '2.18.6'
nuget.exe install Oracle.ManagedDataAccess.Core -Version $version -OutputDirectory out
code out\Oracle.ManagedDataAccess.Core.$version\readme.txt
$version = '2.18.5'
nuget.exe install Oracle.ManagedDataAccess.Core -Version $version -OutputDirectory out
code out\Oracle.ManagedDataAccess.Core.$version\readme.txt
$version = '2.18.3'
nuget.exe install Oracle.ManagedDataAccess.Core -Version $version -OutputDirectory out
code out\Oracle.ManagedDataAccess.Core.$version\readme.txt

Oracle.EntityFrameworkCore NuGet Package Version 2.19.30 README

Release Notes: ODP.NET Entity Framework Core

July 2019

This document provides information that supplements the ODP.NET Entity Framework Core documentation.

This product's license agreement is available at https://www.oracle.com/downloads/licenses/distribution-license.html

TABLE OF CONTENTS

  • New Features
  • Bug Fixes
  • Documentation Corrections and Additions
  • Tips, Limitations, and Known Issues

New Features

This is the first production release.

Bug Fixes since Oracle.EntityFrameworkCore NuGet Package 2.19.0-beta4

  • 29884678 SCAFFOLDING HAVING SLOW PERFORMANCE
  • 29869460 MIGRATIONS RESULT IN SQL MISSING RIGHT PARENTHESIS ERROR WHEN ADDING DATETIME FIELD
  • 29869371 INDEX OUT OF RANGE ERROR WHEN SAVING ENTITY TO CONTEXT 11.2
  • 29822270 MIGRATIONS RESULT IN ORA-00942: TABLE OR VIEW DOES NOT EXIST WHEN TABLE EXISTS IN ANOTHER SCHEMA
  • 29817077 LINQ QUERY RESULTS IN ORA-12704: CHARACTER SET MISMATCH
  • 29798061 INCORRECT RESULTS WHEN SELECTING FOR NON-NULL VALUES
  • 29683096 DBUPDATECONCURRENCYEXCEPTION FROM SAVECHANGESASYNC WHEN SAVING MORE THAN ONE ROW
  • 28963848 FILTER SCHEMA DOES NOT WORK WITH DIFFERENT SCHEMA

Documentation Corrections and Additions

None

Tips, Limitations, and Known Issues

Code First

  • The HasIndex() Fluent API cannot be invoked on an entity property that will result in a primary key in the Oracle database. Oracle Database does not support index creation for primary keys since an index is implicitly created for all primary keys.
  • Oracle Database 11.2 does not support default expression to reference any PL/SQL functions nor any pseudocolumns such as '<sequence>.NEXTVAL'. As such, HasDefaultValue() and HasDefaultValueSql() Fluent APIs cannot be used in conjunction with 'sequence.NETVAL' as the default value, for example, with the Oracle Database 11.2. However, the application can use the UseOracleIdentityColumn() extension method to have the column be populated with server generated values even for Oracle Database 11.2. Please read about UseOracleIdentityColumn() for more details.

Computed Columns

  • Literal values used for computed columns must be encapsulated by two single-quotes. In the example below, the literal string is the comma. It needs to be surrounded by two single-quotes as shown below.

    // C# - computed columns code sample modelBuilder.Entity() .Property(b => b.BlogOwner) .HasComputedColumnSql(""LastName" || '','' || "FirstName"");

Database Scalar Function Mapping

  • Database scalar function mapping does not provide a native way to use functions residing within PL/SQL packages. To work around this limitation, map the package and function to an Oracle synonym, then map the synonym to the EF Core function.

LINQ

  • Oracle Database 12.1 has the following limitation: if the select list contains columns with identical names and you specify the row limiting clause, then an ORA-00918 error occurs. This error occurs whether the identically named columns are in the same table or in different tables.

    Let us suppose that database contains following two table definitions:

    * SQL> desc X;
    Name    Null?    Type
    ------- -------- ----------------------------
    COL1    NOT NULL NUMBER(10)
    COL2             NVARCHAR2(2000)
    
    SQL> desc Y;
    Name    Null?    Type
    ------- -------- ----------------------------
    COL0    NOT NULL NUMBER(10)
    COL1             NUMBER(10)
    COL3             NVARCHAR2(2000)

    Executing the following LINQ, for example, would generate a select query which would contain "COL1" column from both the tables. Hence, it would result in error ORA-00918:

    dbContext.Y.Include(a => a.X).Skip(2).Take(3).ToList();

    This error does not occur when using Oracle Database 11.2, 12.2, and higher versions.

  • The filter property for a DatabaseIndex always returns NULL.

    For example, let us create the following table with a unique index:

    CREATE TABLE FilteredIndexTable (Id1 number, Id2 number NULL);
    CREATE UNIQUE INDEX IX_UNIQUE ON FilteredIndexTable (CASE WHEN Id2 > 10 THEN Id2 ELSE NULL END);

    If indexes are attempted to be obtained, then executing index.Filter will return null.

    var index = dbModel.Tables.Single().Indexes;
  • Certain LINQs cannot be executed against Oracle Database 11.2.

    Let us first imagine an Entity Model with the following entities:

    public class Gear
    {
        public string FullName { get; set; }
        public virtual ICollection<Weapon> Weapons { get; set; }
    }
    
    public class Weapon
    {
        public int Id { get; set; }
        public bool IsAutomatic { get; set; }
        public string OwnerFullName { get; set; }
        public Gear Owner { get; set; }
    }

    The following LINQ will not work against Oracle Database 11.2:

    dbContext.Gear.Include(i => i.Weapons).OrderBy(o => o.Weapons.OrderBy(w => w.Id).FirstOrDefault().IsAutomatic).ToList();

    This is due to LINQ creating the following SQL query:

    SELECT "i"."FullName"
    FROM "Gear" "i"
    ORDER BY (
        Select 
        K0 "IsAutomatic" from(
        SELECT "w"."IsAutomatic" K0
        FROM "Weapon" "w"
        WHERE ("i"."FullName" = "w"."OwnerFullName")
        ORDER BY "w"."Id" NULLS FIRST
        ) "m1"
        where rownum <= 1
    ) NULLS FIRST, "i"."FullName" NULLS FIRST

    Within the SELECT statement, there are two nested SELECTs. The generated SQL will encounter a ORA-00904 : "invalid identifier" error with Oracle Database 11.2 since it has a restriction where it does not recognize outer select table alias "i" in the inner nested select query.

  • 'Invalid column name' error when executing LINQ against a table that contains a column name with NLS (Unicode) characters.

    Let us first imagine an Entity Model with the following entity:

    [Table("Tags")]
    public class Tag
    {
      [Key]
      public decimal tagId { get; set; }
      public String name { get; set; }
      public int rating { get; set; }
    
      String ToString() { return $"{tagId}, {name}";  }
    }
    
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
      modelBuilder.Entity<Tag>(
        b =>
        {
          b.ToTable("Tags");
          b.Property(o => o.rating).HasColumnName("?ating");
        });
    }

    The following LINQ will generate an 'Invalid column name' error.

    var z = (from o in db.Tags.Select(b => new { b.rating, b.tagId }).OrderBy(x => x.tagId).Distinct().GroupBy(y => y.tagId)
                      select o);

    This issue requires a fix in Microsoft's "Relational" nuget package. dotnet/efcore#15904

Migrations

  • The UInt64 data type is not supported for Entity Framework Core Migrations.
  • If more than one column is associated with any sequence/trigger, then ValueGeneratedOnAdd() Fluent API will be generated for each of these columns when performing a scaffolding operation. If we then use this scaffolded model to perform a migration, then an issue occurs. Each column associated with the ValueGeneratedOnAdd() Fluent API is made an identity column by default. To avoid this issue, use UseOracleSQLCompatibility("11") which will force Entity Framework Core to generate triggers/sequences instead.

Scaffolding

  • Scaffolding a table that uses Function Based Indexes is supported. However, the index will NOT be scaffolded.
  • HasColumnType and IsFixedLength Fluent API is not generated while scaffolding a table with a NCHAR column. This issue requires a fix in Microsoft's "Relational" nuget package.

Sequences

  • A sequence cannot be restarted.
  • Extension methods related to SequenceHiLo is not supported.

Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.

Oracle.EntityFrameworkCore NuGet Package Version 2.19.50 README

Release Notes: ODP.NET Entity Framework Core

October 2019

This document provides information that supplements the ODP.NET Entity Framework Core documentation.

This product's license agreement is available at https://www.oracle.com/downloads/licenses/distribution-license.html

TABLE OF CONTENTS

  • New Features
  • Bug Fixes
  • Documentation Corrections and Additions
  • Tips, Limitations, and Known Issues

New Features

  1. .NET Core 2.1 certification - This release adds backwards compatibility support for .NET Core and EF Core 2.1.

Bug Fixes since Oracle.EntityFrameworkCore NuGet Package 2.19.30

  • Bug 30134453 : LONG COLUMN DOES NOT GET RETRIEVED PROPERLY
  • Bug 30158965 : "VALUE CANNOT BE NULL" WHEN USING SCAFFOLDING AND USING FUNCTION BASED INDEX WITH SCHEMA SPECIFIED

Documentation Corrections and Additions

None

Tips, Limitations, and Known Issues

Code First

  • The HasIndex() Fluent API cannot be invoked on an entity property that will result in a primary key in the Oracle database. Oracle Database does not support index creation for primary keys since an index is implicitly created for all primary keys.
  • Oracle Database 11.2 does not support default expression to reference any PL/SQL functions nor any pseudocolumns such as '.NEXTVAL'. As such, HasDefaultValue() and HasDefaultValueSql() Fluent APIs cannot be used in conjunction with 'sequence.NETVAL' as the default value, for example, with the Oracle Database 11.2. However, the application can use the UseOracleIdentityColumn() extension method to have the column be populated with server generated values even for Oracle Database 11.2. Please read about UseOracleIdentityColumn() for more details.

Computed Columns

  • Literal values used for computed columns must be encapsulated by two single-quotes. In the example below, the literal string is the comma. It needs to be surrounded by two single-quotes as shown below.

    // C# - computed columns code sample
    modelBuilder.Entity<Blog>()
    .Property(b => b.BlogOwner)
    .HasComputedColumnSql("\"LastName\" || '','' || \"FirstName\"");

Database Scalar Function Mapping

  • Database scalar function mapping does not provide a native way to use functions residing within PL/SQL packages. To work around this limitation, map the package and function to an Oracle synonym, then map the synonym to the EF Core function.

LINQ

  • Oracle Database 12.1 has the following limitation: if the select list contains columns with identical names and you specify the row limiting clause, then an ORA-00918 error occurs. This error occurs whether the identically named columns are in the same table or in different tables.

    Let us suppose that database contains following two table definitions:

    * SQL> desc X;
    Name    Null?    Type
    ------- -------- ----------------------------
    COL1    NOT NULL NUMBER(10)
    COL2             NVARCHAR2(2000)
    
    SQL> desc Y;
    Name    Null?    Type
    ------- -------- ----------------------------
    COL0    NOT NULL NUMBER(10)
    COL1             NUMBER(10)
    COL3             NVARCHAR2(2000)

    Executing the following LINQ, for example, would generate a select query which would contain "COL1" column from both the tables. Hence, it would result in error ORA-00918:

    dbContext.Y.Include(a => a.X).Skip(2).Take(3).ToList();

    This error does not occur when using Oracle Database 11.2, 12.2, and higher versions.

  • The filter property for a DatabaseIndex always returns NULL.

    For example, let us create the following table with a unique index:

    CREATE TABLE FilteredIndexTable (Id1 number, Id2 number NULL);
    CREATE UNIQUE INDEX IX_UNIQUE ON FilteredIndexTable (CASE WHEN Id2 > 10 THEN Id2 ELSE NULL END);

    If indexes are attempted to be obtained, then executing index.Filter will return null.

    var index = dbModel.Tables.Single().Indexes;
  • Certain LINQs cannot be executed against Oracle Database 11.2.

    Let us first imagine an Entity Model with the following entities:

    public class Gear
    {
        public string FullName { get; set; }
        public virtual ICollection<Weapon> Weapons { get; set; }
    }
    
    public class Weapon
    {
        public int Id { get; set; }
        public bool IsAutomatic { get; set; }
        public string OwnerFullName { get; set; }
        public Gear Owner { get; set; }
    }

    The following LINQ will not work against Oracle Database 11.2:

    dbContext.Gear.Include(i => i.Weapons).OrderBy(o => o.Weapons.OrderBy(w => w.Id).FirstOrDefault().IsAutomatic).ToList();

    This is due to LINQ creating the following SQL query:

    SELECT "i"."FullName"
    FROM "Gear" "i"
    ORDER BY (
        Select
        K0 "IsAutomatic" from(
        SELECT "w"."IsAutomatic" K0
        FROM "Weapon" "w"
        WHERE ("i"."FullName" = "w"."OwnerFullName")
        ORDER BY "w"."Id" NULLS FIRST
        ) "m1"
        where rownum <= 1
    ) NULLS FIRST, "i"."FullName" NULLS FIRST

    Within the SELECT statement, there are two nested SELECTs. The generated SQL will encounter a ORA-00904 : "invalid identifier" error with Oracle Database 11.2 since it has a restriction where it does not recognize outer select table alias "i" in the inner nested select query.

  • 'Invalid column name' error when executing LINQ against a table that contains a column name with NLS (Unicode) characters.

    Let us first imagine an Entity Model with the following entity:

    [Table("Tags")]
    public class Tag
    {
      [Key]
      public decimal tagId { get; set; }
      public String name { get; set; }
      public int rating { get; set; }
    
      String ToString() { return $"{tagId}, {name}";  }
    }
    
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
      modelBuilder.Entity<Tag>(
        b =>
        {
          b.ToTable("Tags");
          b.Property(o => o.rating).HasColumnName("評ating");
        });
    }

    The following LINQ will generate an 'Invalid column name' error.

    var z = (from o in db.Tags.Select(b => new { b.rating, b.tagId }).OrderBy(x => x.tagId).Distinct().GroupBy(y => y.tagId)
                      select o);

    This issue requires a fix in Microsoft’s “Relational” nuget package.

Migrations

  • The UInt64 data type is not supported for Entity Framework Core Migrations.
  • If more than one column is associated with any sequence/trigger, then ValueGeneratedOnAdd() Fluent API will be generated for each of these columns when performing a scaffolding operation. If we then use this scaffolded model to perform a migration, then an issue occurs. Each column associated with the ValueGeneratedOnAdd() Fluent API is made an identity column by default. To avoid this issue, use UseOracleSQLCompatibility("11") which will force Entity Framework Core to generate triggers/sequences instead.

Scaffolding

  • Scaffolding a table that uses Function Based Indexes is supported. However, the index will NOT be scaffolded.
  • HasColumnType and IsFixedLength Fluent API is not generated while scaffolding a table with a NCHAR column. This issue requires a fix in Microsoft’s “Relational” nuget package.

Sequences

  • A sequence cannot be restarted.
  • Extension methods related to SequenceHiLo is not supported.

Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.

Oracle.EntityFrameworkCore NuGet Package Version 2.19.60 README

Release Notes: ODP.NET Entity Framework Core

November 2019

This document provides information that supplements the ODP.NET Entity Framework Core documentation.

This product's license agreement is available at https://www.oracle.com/downloads/licenses/distribution-license.html

TABLE OF CONTENTS

  • New Features
  • Bug Fixes
  • Documentation Corrections and Additions
  • Tips, Limitations, and Known Issues

New Features

None

Certification

  1. This release is certified with .NET Core 2.1 - It adds backwards compatibility support for .NET Core and EF Core 2.1.

Bug Fixes since Oracle.EntityFrameworkCore NuGet Package 2.19.50

  • Bug 30452644 - EFCORE: DBUPDATECONCURRENCYEXCEPTION SAVECHANGESASYNC WHEN SAVING MORE THAN ONE ROW
  • Bug 30352492 - EFCORE: MIGRATIONS: ORA-00904: "T"."OWNER": INVALID IDENTIFIER

Documentation Corrections and Additions

None

Tips, Limitations, and Known Issues

Code First

  • The HasIndex() Fluent API cannot be invoked on an entity property that will result in a primary key in the Oracle database. Oracle Database does not support index creation for primary keys since an index is implicitly created for all primary keys.
  • Oracle Database 11.2 does not support default expression to reference any PL/SQL functions nor any pseudocolumns such as '.NEXTVAL'. As such, HasDefaultValue() and HasDefaultValueSql() Fluent APIs cannot be used in conjunction with 'sequence.NETVAL' as the default value, for example, with the Oracle Database 11.2. However, the application can use the UseOracleIdentityColumn() extension method to have the column be populated with server generated values even for Oracle Database 11.2. Please read about UseOracleIdentityColumn() for more details.

Computed Columns

  • Literal values used for computed columns must be encapsulated by two single-quotes. In the example below, the literal string is the comma. It needs to be surrounded by two single-quotes as shown below.

    // C# - computed columns code sample
    modelBuilder.Entity<Blog>()
    .Property(b => b.BlogOwner)
    .HasComputedColumnSql("\"LastName\" || '','' || \"FirstName\"");

Database Scalar Function Mapping

  • Database scalar function mapping does not provide a native way to use functions residing within PL/SQL packages. To work around this limitation, map the package and function to an Oracle synonym, then map the synonym to the EF Core function.

LINQ

  • Oracle Database 12.1 has the following limitation: if the select list contains columns with identical names and you specify the row limiting clause, then an ORA-00918 error occurs. This error occurs whether the identically named columns are in the same table or in different tables.

    Let us suppose that database contains following two table definitions:

    * SQL> desc X;
    Name    Null?    Type
    ------- -------- ----------------------------
    COL1    NOT NULL NUMBER(10)
    COL2             NVARCHAR2(2000)
    
    SQL> desc Y;
    Name    Null?    Type
    ------- -------- ----------------------------
    COL0    NOT NULL NUMBER(10)
    COL1             NUMBER(10)
    COL3             NVARCHAR2(2000)

    Executing the following LINQ, for example, would generate a select query which would contain "COL1" column from both the tables. Hence, it would result in error ORA-00918:

    dbContext.Y.Include(a => a.X).Skip(2).Take(3).ToList();

    This error does not occur when using Oracle Database 11.2, 12.2, and higher versions.

  • The filter property for a DatabaseIndex always returns NULL.

    For example, let us create the following table with a unique index:

    CREATE TABLE FilteredIndexTable (Id1 number, Id2 number NULL);
    CREATE UNIQUE INDEX IX_UNIQUE ON FilteredIndexTable (CASE WHEN Id2 > 10 THEN Id2 ELSE NULL END);

    If indexes are attempted to be obtained, then executing index.Filter will return null.

    var index = dbModel.Tables.Single().Indexes;
  • Certain LINQs cannot be executed against Oracle Database 11.2.

    Let us first imagine an Entity Model with the following entities:

    public class Gear
    {
        public string FullName { get; set; }
        public virtual ICollection<Weapon> Weapons { get; set; }
    }
    
    public class Weapon
    {
        public int Id { get; set; }
        public bool IsAutomatic { get; set; }
        public string OwnerFullName { get; set; }
        public Gear Owner { get; set; }
    }

    The following LINQ will not work against Oracle Database 11.2:

    dbContext.Gear.Include(i => i.Weapons).OrderBy(o => o.Weapons.OrderBy(w => w.Id).FirstOrDefault().IsAutomatic).ToList();

    This is due to LINQ creating the following SQL query:

    SELECT "i"."FullName"
    FROM "Gear" "i"
    ORDER BY (
        Select
        K0 "IsAutomatic" from(
        SELECT "w"."IsAutomatic" K0
        FROM "Weapon" "w"
        WHERE ("i"."FullName" = "w"."OwnerFullName")
        ORDER BY "w"."Id" NULLS FIRST
        ) "m1"
        where rownum <= 1
    ) NULLS FIRST, "i"."FullName" NULLS FIRST

    Within the SELECT statement, there are two nested SELECTs. The generated SQL will encounter a ORA-00904 : "invalid identifier" error with Oracle Database 11.2 since it has a restriction where it does not recognize outer select table alias "i" in the inner nested select query.

  • 'Invalid column name' error when executing LINQ against a table that contains a column name with NLS (Unicode) characters.

    Let us first imagine an Entity Model with the following entity:

    [Table("Tags")]
    public class Tag
    {
      [Key]
      public decimal tagId { get; set; }
      public String name { get; set; }
      public int rating { get; set; }
    
      String ToString() { return $"{tagId}, {name}";  }
    }
    
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
      modelBuilder.Entity<Tag>(
        b =>
        {
          b.ToTable("Tags");
          b.Property(o => o.rating).HasColumnName("評ating");
        });
    }

    The following LINQ will generate an 'Invalid column name' error.

    var z = (from o in db.Tags.Select(b => new { b.rating, b.tagId }).OrderBy(x => x.tagId).Distinct().GroupBy(y => y.tagId)
                      select o);

    This issue requires a fix in Microsoft’s “Relational” nuget package.

Migrations

  • The UInt64 data type is not supported for Entity Framework Core Migrations.
  • If more than one column is associated with any sequence/trigger, then ValueGeneratedOnAdd() Fluent API will be generated for each of these columns when performing a scaffolding operation. If we then use this scaffolded model to perform a migration, then an issue occurs. Each column associated with the ValueGeneratedOnAdd() Fluent API is made an identity column by default. To avoid this issue, use UseOracleSQLCompatibility("11") which will force Entity Framework Core to generate triggers/sequences instead.

Scaffolding

  • Scaffolding a table that uses Function Based Indexes is supported. However, the index will NOT be scaffolded.
  • HasColumnType and IsFixedLength Fluent API is not generated while scaffolding a table with a NCHAR column. This issue requires a fix in Microsoft’s “Relational” nuget package.

Sequences

  • A sequence cannot be restarted.
  • Extension methods related to SequenceHiLo is not supported.

Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.

Oracle.EntityFrameworkCore NuGet Package Version 2.19.70 README

Release Notes: ODP.NET Entity Framework Core

February 2020

This document provides information that supplements the ODP.NET Entity Framework Core documentation.

This product's license agreement is available at https://www.oracle.com/downloads/licenses/distribution-license.html

TABLE OF CONTENTS

  • New Features
  • Bug Fixes
  • Documentation Corrections and Additions
  • Tips, Limitations, and Known Issues

New Features

None

Bug Fixes since Oracle.EntityFrameworkCore NuGet Package 2.19.60

<<<<<<< 754BAD78E0B18E15E0533B99EB0A1D8C.4
Bug 30487100 : LONG COLUMN DATA IS RETURNED AS STRING.EMPTY
=======
Bug 30487100 : LONG COLUMN DATA IS RETURNED AS STRING.EMPTY
Bug 30658016 : CANNOT CONVERT EXISTING NON-NULL COLUMN TO NULLABLE 
>>>>>>> 1

Documentation Corrections and Additions

None

Tips, Limitations, and Known Issues

Code First

  • The HasIndex() Fluent API cannot be invoked on an entity property that will result in a primary key in the Oracle database. Oracle Database does not support index creation for primary keys since an index is implicitly created for all primary keys.
  • Oracle Database 11.2 does not support default expression to reference any PL/SQL functions nor any pseudocolumns such as '.NEXTVAL'. As such, HasDefaultValue() and HasDefaultValueSql() Fluent APIs cannot be used in conjunction with 'sequence.NETVAL' as the default value, for example, with the Oracle Database 11.2. However, the application can use the UseOracleIdentityColumn() extension method to have the column be populated with server generated values even for Oracle Database 11.2. Please read about UseOracleIdentityColumn() for more details.

Computed Columns

  • Literal values used for computed columns must be encapsulated by two single-quotes. In the example below, the literal string is the comma. It needs to be surrounded by two single-quotes as shown below.

    // C# - computed columns code sample
    modelBuilder.Entity<Blog>()
    .Property(b => b.BlogOwner)
    .HasComputedColumnSql("\"LastName\" || '','' || \"FirstName\"");

Database Scalar Function Mapping

  • Database scalar function mapping does not provide a native way to use functions residing within PL/SQL packages. To work around this limitation, map the package and function to an Oracle synonym, then map the synonym to the EF Core function.

LINQ

  • Oracle Database 12.1 has the following limitation: if the select list contains columns with identical names and you specify the row limiting clause, then an ORA-00918 error occurs. This error occurs whether the identically named columns are in the same table or in different tables.

    Let us suppose that database contains following two table definitions:

    * SQL> desc X;
    Name    Null?    Type
    ------- -------- ----------------------------
    COL1    NOT NULL NUMBER(10)
    COL2             NVARCHAR2(2000)
    
    SQL> desc Y;
    Name    Null?    Type
    ------- -------- ----------------------------
    COL0    NOT NULL NUMBER(10)
    COL1             NUMBER(10)
    COL3             NVARCHAR2(2000)

    Executing the following LINQ, for example, would generate a select query which would contain "COL1" column from both the tables. Hence, it would result in error ORA-00918:

    dbContext.Y.Include(a => a.X).Skip(2).Take(3).ToList();

    This error does not occur when using Oracle Database 11.2, 12.2, and higher versions.

  • The filter property for a DatabaseIndex always returns NULL.

    For example, let us create the following table with a unique index:

    CREATE TABLE FilteredIndexTable (Id1 number, Id2 number NULL);
    CREATE UNIQUE INDEX IX_UNIQUE ON FilteredIndexTable (CASE WHEN Id2 > 10 THEN Id2 ELSE NULL END);

    If indexes are attempted to be obtained, then executing index.Filter will return null.

    var index = dbModel.Tables.Single().Indexes;
  • Certain LINQs cannot be executed against Oracle Database 11.2.

    Let us first imagine an Entity Model with the following entities:

    public class Gear
    {
        public string FullName { get; set; }
        public virtual ICollection<Weapon> Weapons { get; set; }
    }
    
    public class Weapon
    {
        public int Id { get; set; }
        public bool IsAutomatic { get; set; }
        public string OwnerFullName { get; set; }
        public Gear Owner { get; set; }
    }

    The following LINQ will not work against Oracle Database 11.2:

    dbContext.Gear.Include(i => i.Weapons).OrderBy(o => o.Weapons.OrderBy(w => w.Id).FirstOrDefault().IsAutomatic).ToList();

    This is due to LINQ creating the following SQL query:

    SELECT "i"."FullName"
    FROM "Gear" "i"
    ORDER BY (
        Select
        K0 "IsAutomatic" from(
        SELECT "w"."IsAutomatic" K0
        FROM "Weapon" "w"
        WHERE ("i"."FullName" = "w"."OwnerFullName")
        ORDER BY "w"."Id" NULLS FIRST
        ) "m1"
        where rownum <= 1
    ) NULLS FIRST, "i"."FullName" NULLS FIRST

    Within the SELECT statement, there are two nested SELECTs. The generated SQL will encounter a ORA-00904 : "invalid identifier" error with Oracle Database 11.2 since it has a restriction where it does not recognize outer select table alias "i" in the inner nested select query.

  • 'Invalid column name' error when executing LINQ against a table that contains a column name with NLS (Unicode) characters.

    Let us first imagine an Entity Model with the following entity:

    [Table("Tags")]
    public class Tag
    {
      [Key]
      public decimal tagId { get; set; }
      public String name { get; set; }
      public int rating { get; set; }
    
      String ToString() { return $"{tagId}, {name}";  }
    }
    
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
      modelBuilder.Entity<Tag>(
        b =>
        {
          b.ToTable("Tags");
          b.Property(o => o.rating).HasColumnName("評ating");
        });
    }

    The following LINQ will generate an 'Invalid column name' error.

    var z = (from o in db.Tags.Select(b => new { b.rating, b.tagId }).OrderBy(x => x.tagId).Distinct().GroupBy(y => y.tagId)
                      select o);

    This issue requires a fix in Microsoft’s “Relational” nuget package.

Migrations

  • The UInt64 data type is not supported for Entity Framework Core Migrations.
  • If more than one column is associated with any sequence/trigger, then ValueGeneratedOnAdd() Fluent API will be generated for each of these columns when performing a scaffolding operation. If we then use this scaffolded model to perform a migration, then an issue occurs. Each column associated with the ValueGeneratedOnAdd() Fluent API is made an identity column by default. To avoid this issue, use UseOracleSQLCompatibility("11") which will force Entity Framework Core to generate triggers/sequences instead.

Scaffolding

  • Scaffolding a table that uses Function Based Indexes is supported. However, the index will NOT be scaffolded.
  • HasColumnType and IsFixedLength Fluent API is not generated while scaffolding a table with a NCHAR column. This issue requires a fix in Microsoft’s “Relational” nuget package.

Sequences

  • A sequence cannot be restarted.
  • Extension methods related to SequenceHiLo is not supported.

Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.

Oracle.ManagedDataAccess.Core NuGet Package 2.18.5 README

March 2019

For documentation, go to https://docs.oracle.com/en/database/oracle/oracle-data-access-components/18.3/

Bug Fixes since Oracle.ManagedDataAccess.Core 2.18.3

  • Bug 29033896: SYSTEM.IO.IOEXCEPTION IS ENCOUNTERED FOR ONS-BASED HA/RLB REGISTRATIONS
  • Bug 28747690: SSL CONNECTIONS RESULTS IN ORA-00542: FAILURE DURING SSL HANDSHAKE
  • Bug 28085865: PLSQLASSOCIATIVEARRAY : PRECISION NOT APPLIED TO ALL THE ELEMENTS IN THE ARRAY BIND

Oracle.ManagedDataAccess.Core NuGet Package 2.18.6 README

March 2019

For documentation, go to https://docs.oracle.com/en/database/oracle/oracle-data-access-components/18.3/

Bug Fixes since Oracle.ManagedDataAccess.Core 2.18.5

  • Bug 29242017 - PARAMETER IN NVL FUNCTION RESULTS IN READONLY COLUMNS IN DATASET
  • Bug 29412269 - ODP.NET DRIVER DOES NOT SHARE CURSORS FOR EXECUTIONS WITH NULL / NON-NULL PARAMETER VALUES
  • Bug 29314539 - ODP.NET ORACLE CONNECTION FAILS IF TABS EXIST BEFORE / AFTER USER ID
  • Bug 28728040 - ODP.NET MANAGED DRIVER FAILED TO SWITCH OVER TO STANDBY DB IN DATAGUARD ENVIRONMENT
  • Bug 28632559 - CONNECTION TO STANDBY DB CAUSES ORA-01219

ODP.NET Core Tips, Limitations, and Known Issues

  1. ODP.NET 12c and 18c PL/SQL CHAR Binding Error "ORA-12899: Value Too Large for Column" When Inserting into a Table

    Issue:

    After patching managed Oracle Data Provider for .NET (ODP.NET) 12.x / 18.x or ODP.NET Core version 18.x, customers may encounter the "ORA-12899: Value Too Large for Column" error when binding CHAR parameters in PL/SQL which in turn inserts that value to a character based column in a database, that uses a multi-byte character set, such as AL32UTF8 where one character can take up as much as 4 bytes.

    Explanation:

    Due to a fix to a bug that forces ODP.NET to bind data with the "max byte size", the PL/SQL layer will create a blank-padded value that is beyond the size that the column can accept, since ODP.NET is required to provide the size of the parameter in terms of characters multiplied by the character expansion ratio.

    Imagine that you have the following table created in a database with the AL32UTF8 mult-byte character set:

    create table testchar_tab (char_column char(40));

    And let us assume that you have the following PL/SQL stored procedure:

    CREATE OR REPLACE PROCEDURE insert_row(param1 IN CHAR) AS
    BEGIN
      INSERT INTO testchar_tab (CHAR_COLUMN) VALUES(param1);
    END;
    /

    With the previous version of managed ODP.NET 12.x / 18.x or ODP.NET Core 18.x, the application would have been able to insert character based data up to 40 characters. However, starting with this patch, you will not able to insert more than 10 characters in this particular example, since PL/SQL layer will blank pad the data to 10 (characters) * 4 (character expansion ratio), which is 40 bytes, the max length of the CHAR column.

    Resolution:

    One workaround for this issue is to change the PL/SQL parameter type from CHAR to VARCHAR2, which eliminates the blank padding in the PL/SQL layer:

    CREATE OR REPLACE PROCEDURE insert_row(param1 IN VARCHAR2) AS
    BEGIN
      INSERT INTO testchar_tab (CHAR_COLUMN) VALUES(param1);
    END;
    /

    The alternative approach is to bypass PL/SQL and insert directly into the table using SQL to avoid the blank padding by the PL/SQL layer.

Oracle.ManagedDataAccess.Core NuGet Package 2.19.31 README

Release Notes: Oracle Data Provider for .NET Core

July 2019

New Features

  1. More Configuration Options with New OracleConnection Properties:

    • KeepAlive, KeepAliveInterval, and KeepAliveTime - specifies whether and the conditions under which to keep idle connections alive
    • TnsAdmin - specifies the tnsnames.ora and sqlnet.ora directory
    • WalletLocation - specifies the wallet directory location

Oracle.ManagedDataAccess.Core NuGet Package 2.19.50 README

Release Notes: Oracle Data Provider for .NET Core

October 2019

New Features

  1. .NET Core 3.0 certification

Bug Fixes since Oracle.ManagedDataAccess.Core NuGet Package 2.19.31

  • Bug 30266960 : NEW CONNECTION CREATION DELAY WHEN CONNECTIONS HAVE BEEN SEVERED

Oracle.ManagedDataAccess.Core NuGet Package 2.19.60 README

Release Notes: Oracle Data Provider for .NET Core

November 2019

New Features

None

Certification

  1. This release is certified with .NET Core 3.0.

Bug Fixes since Oracle.ManagedDataAccess.Core NuGet Package 2.19.50

  • 30421722 ODP.NET CORE FAILS TO LINK PROPERLY FOR XAMARIN ANDROID DUE TO SYSTEM.INVALIDCASTEXCEPTION
  • 30266960 CONNECTION CREATION DELAY IS OBSERVED WHEN TRYING TO OPEN CONNECTION FOR SECOND TIME IN ASP.NET APPLICATION
  • 30190314 DOUBLE QUATED PLACEFOLDER CAUSE 'INVALID PARAMETER BINDING' WITH BINDBYNAME=TRUE ON ODP.NET MANAGED AND CORE
  • 30134453 LONG COLUMN DOES NOT RETURN DATA
  • 30107816 ODP.NET MANAGED & CORE : THROWING "INDEX WAS OUTSIDE THE BOUNDS OF THE ARRAY" ERROR AFTER UPGRADING DB TO 18C
  • 29956349 METACHARACTERS IN NETWORK SHARE DIRECTORY PATH FOR TNSADMIN PRODUCE INCORRECT PATH NAME
  • 29885887 ORACLEREFCURSOR: SLOWER PERFORMANCE USING IDENTITY VS. SEQUENCE
  • 29822515 INVALIDCASTEXCEPTION OCCUR WHEN ODP.NET MANAGED AND CORE ISSUES SQL WITH ARRAY BIND
  • 29760546 GETSCHEMATABLE SPLITS DBLINK INTO MORE THAN THREE PARTS CAUSING INDEXOUTOFRANGEEXCEPTION
  • 29630212 CALL TO UPDATE ON DA FAILS WITH NULLREFERENCEEXCEPTION WHEN UPDATEBATCHSIZE > 1
  • 29237698 DIFFERENT VALUE IS SET TO DATATABLE.COLUMNS.READONLY PROPERTY FOR ODP.NET MANAGED & CORE
  • 29183084 ODP.NET MANAGED & CORE : CONNECTION.CLOSE DOES NOT CLEAR MODULE, ACTION, CLIENT_IDENTIFIER ATTRIBUTES IN V$SESSION
  • 28468785 ASSOCIATIVE ARRAY WITH RAW OUT PARAMETER TRUNCATES DATA
  • 27815019 ORACLEDECIMAL.VALUE RETURNS INCORRECT VALUE AFTER SETPRECISION
  • 26894469 APPLICATIONS RECEIEVE HA/FAN EVENTS THAT NOT ESSENTIAL FOR CONNECTION CLEAN-UP
  • 24289289 INLINE SQL COMMENT /**/ CAUSES INDEX OUTSIDE THE BOUNDS OF THE ARRAY ERROR

Oracle.ManagedDataAccess.Core NuGet Package 2.19.70 README

Release Notes: Oracle Data Provider for .NET Core

April 2020

New Features

  1. .NET Core 3.1 certification

    ODP.NET Core 2.19.60 and higher is certified and supported with .NET Core 3.1.

  2. Linux 8 certification

    ODP.NET Core 2.19.60 and higher is certified and supported with Oracle Linux 8 and Red Hat Enterprise Linux 8.

  3. Websocket and Websocket with SSL/TLS

    Websocket is a protocol that offers full-duplex communication channels over a single TCP connection. WebSocket with SSL/TLS offers a secure WebSocket connection. WebSocket is an extension to HTTP and is able to work with HTTP proxies and intermediaries. ODP.NET Core now supports Websocket and Websocket with SSL/TLS.

  4. Connection String attributes: Tns_Admin and Wallet_Location

    ODP.NET Core can now set the TNS admin directory and wallet location directory on the connection string.

  5. SYSASM Privilege

    Oracle Automatic Storage Management (Oracle ASM) is a volume manager and a file system for Oracle database files. SYSASM is a system privilege that enables administrators to manage ASM instances. ODP.NET Core can now connect using the SYSASM administrative privilege to perform storage management of the Oracle Database.

Bug Fixes since Oracle.ManagedDataAccess.Core NuGet Package 2.19.60

  • Bug 30739835 : NULLREFERENCEEXCEPTION IS OBSERVED IN RED HAT KUBERNETES ON DOCKER
  • Bug 29849626: MAC: HANDSHAKE ERROR "ORA-00542" WHEN OPEN SSL CONNECTION AGAINST ATP/ADW

Note on Bug 29849626 fix: This bug fix now enables ODP.NET Core TLS/SSL for .NET Core 3.x. To use the feature, the System.Security.Cryptography.Pkcs (>= 4.7.0) package, available on NuGet Gallery, must be available for the application to load/use. To accomplish this, applications can add the package as a reference to the project, then rebuild or install the package to the NuGet cache, such as through the "nuget.exe install" operation."

Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment