Page 1 of 1

Identifier is too long - Oracle 12.2 Compatible to 12.1

Posted: Mon 24 Sep 2018 13:24
by Susanna
Dear DevArt Team,

I'm getting an exception ORA-00972: identifier is too long on Oracle 12.2 BUT compatible to 12.1. DevArt 9.6.540.
The generated queries by EF 6 have more than 30 characters assuming that the Oracle version is 12.2 but actually it doesn't have the features of 12.2 since compatible with 12.1.

Could you please investigate this?
Thanks in advance.

Re: Identifier is too long - Oracle 12.2 Compatible to 12.1

Posted: Fri 28 Sep 2018 17:40
by Shalex
1. Try setting this option in your code before the context usage (or in a static context constructor):

Code: Select all

    var config = Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfig.Instance;
    config.CodeFirstOptions.TruncateLongDefaultNames = true;
2. If this doesn't help:
a) specify the database object (table, column, index, foreign key, etc) which name exceeds the 128 bytes limit for identifiers in Oracle 12.2
b) the name itself that fails to be created

JIC: enable dbMonitor to trace the SQL statements sent to Oracle Server

Re: Identifier is too long - Oracle 12.2 Compatible to 12.1

Posted: Fri 29 Nov 2019 15:29
by vfel
Dear DevArt Team,

I come Back to this topic because I think we have the same Problem with a Orcale 19c DB.
When we connect to an Oracle 11g or 12c R1 DB tables are created as expected and Index and Foreign Key Names longer than 30 bytes are replaced with short names.
When connecting to a 19c DB set compatible to 12c R1 the default names are used exceeding the 30 bytes causing the ORA-00972.
I thing the components expect the name to be limited to 128 bytes because it is a 19c and do not consider the compatible setting.
The TruncateLongDefaultNames setting did not help in my tests. I was able to work around the problem by editing the created migrations. I assume that is what you recommended as option 2. But I'm not really happy with this solution because we wold have to do this with every coming migration.

Is there an other way to get the names shortened in newer Oracle DBs?
Thanks in advance for your help.

Re: Identifier is too long - Oracle 12.2 Compatible to 12.1

Posted: Sat 30 Nov 2019 11:09
by Shalex
@vfel

The bug with using config.CodeFirstOptions.TruncateLongDefaultNames in EF Core is fixed in v9.4.280. We recommend using the newest build v9.9.887.

If this doesn't help, please specify:
1) the version of your Entity Framework (e.g.: EF Core 3)
2) the version of your dotConnect for Oracle (e.g.: 9.9.887)

Re: Identifier is too long - Oracle 12.2 Compatible to 12.1

Posted: Mon 02 Dec 2019 10:39
by vfel
Hi Shalex,

thanks for the quick reply.
we use dotConnect for Oracle in version 9.9.887 and EF Core 2.2.6 (our project is .Net Framework therefore we cannot update to EF Core 3.x).
The problem still seems to be present in this combination.
Let me know if I can provide any other information to localize this problem.

Veit

Re: Identifier is too long - Oracle 12.2 Compatible to 12.1

Posted: Fri 06 Dec 2019 11:23
by Shalex
Thank you for your report. We will investigate the issue with config.CodeFirstOptions.TruncateLongDefaultNames in EF Core 2.2 and notify you about the result.

Re: Identifier is too long - Oracle 12.2 Compatible to 12.1

Posted: Wed 18 Dec 2019 21:21
by Shalex
vfel wrote: Fri 29 Nov 2019 15:29When we connect to an Oracle 11g or 12c R1 DB tables are created as expected and Index and Foreign Key Names longer than 30 bytes are replaced with short names.
When connecting to a 19c DB set compatible to 12c R1 the default names are used exceeding the 30 bytes causing the ORA-00972.
I thing the components expect the name to be limited to 128 bytes because it is a 19c and do not consider the compatible setting.
The TruncateLongDefaultNames setting did not help in my tests.
The new config.CodeFirstOptions.TruncateAllLongNames option (default value is False) is added to use EF Core 2/EF Core 3 implementation for truncating long names of columns and PK/FK/IX/UX. We will notify you when the new build is available for download.

With the new build, you should set the following options in a static constructor of your context:

Code: Select all

    var config = Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfig.Instance;
    config.Workarounds.ProviderManifestToken = "Oracle, 11.2";
    config.CodeFirstOptions.TruncateAllLongNames = true;

Re: Identifier is too long - Oracle 12.2 Compatible to 12.1

Posted: Tue 24 Dec 2019 18:00
by Shalex
dotConnect for Oracle 9.10 is released: viewtopic.php?f=1&t=39716.