You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 4 години
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. Oracle.ManagedDataAccess.EntityFramework Nuget Package Version 19.3.0 README
  2. ============================================================================
  3. Release Notes: Oracle Data Provider for .NET, Managed Driver for Entity Framework
  4. May 2019
  5. This document provides information that supplements the Oracle Data Provider for .NET (ODP.NET) for Entity
  6. Framework documentation. You have downloaded Oracle Data Provider for .NET for Entity Framework from Oracle,
  7. the license agreement to which is available at
  8. http://www.oracle.com/technetwork/licenses/distribution-license-152002.html
  9. TABLE OF CONTENTS
  10. *New Features
  11. *Installation and Configuration Steps
  12. *Installation Changes
  13. *Documentation Corrections and Additions
  14. *Entity Framework Tips, Limitations, and Known Issues
  15. Note: Please consult the ODP.NET, Managed Driver NuGet README at packages\Oracle.ManagedDataAccess.<version>
  16. for more information about the component.
  17. Note: The 32-bit "Oracle Developer Tools for Visual Studio" download from http://otn.oracle.com/dotnet is
  18. required for Entity Framework design-time features. This NuGet download does not enable design-time tools; it
  19. only provides run-time support. This version of ODP.NET for Entity Framework supports Oracle Database version
  20. 11.2 and higher.
  21. New Features
  22. ============
  23. 1. .NET Framework 4.8 is certified with managed ODP.NET Entity Framework.
  24. Installation and Configuration Steps
  25. ====================================
  26. The downloads are NuGet packages that can be installed with the NuGet Package Manager. These instructions apply
  27. to install ODP.NET, Managed Driver for Entity Framework.
  28. 1. Un-GAC any existing ODP.NET for Entity Framework 19 versions you have installed. For example, if you
  29. plan to use only the ODP.NET, Managed Driver for Entity Framework, only un-GAC existing managed ODP.NET for
  30. Entity Framework 19 versions then.
  31. 2. In Visual Studio, open NuGet Package Manager from an existing Visual Studio project.
  32. 3. Install the NuGet package from an OTN-downloaded local package source or from nuget.org.
  33. From Local Package Source
  34. -------------------------
  35. A. Click on the Settings button in the lower left of the dialog box.
  36. B. Click the "+" button to add a package source. In the Source field, enter in the directory location where the
  37. NuGet package(s) were downloaded to. Click the Update button, then the Ok button.
  38. C. On the left side, under the Online root node, select the package source you just created. The ODP.NET for
  39. Entity Framework NuGet package will appear.
  40. From Nuget.org
  41. --------------
  42. A. In the Search box in the upper right, search for the package with id,
  43. "Oracle.ManagedDataAccess.EntityFramework". Verify that the package uses this unique ID to ensure it is the
  44. offical Oracle Data Provider for .NET, Managed Driver for Entity Framework downloads.
  45. B. Select the package you wish to install.
  46. 4. Click on the Install button to select the desired NuGet package(s) to include with the project. Accept the
  47. license agreement and Visual Studio will continue the setup. ODP.NET, Managed Driver will be installed
  48. automatically as a dependency for ODP.NET, Managed Driver for Entity Framework.
  49. 5. Open the app/web.config file to configure the ODP.NET connection string and local naming parameters
  50. (i.e. tnsnames.ora). Below is an example of configuring the local naming parameters:
  51. <oracle.manageddataaccess.client>
  52. <version number="*">
  53. <dataSources>
  54. <!-- Customize these connection alias settings to connect to Oracle DB -->
  55. <dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " />
  56. </dataSources>
  57. </version>
  58. </oracle.manageddataaccess.client>
  59. 6. Modify the app/web.config file's connection string to create a DbContext your Entity Framework application
  60. will use. Below is an example of a configured DbContext.
  61. <connectionStrings>
  62. <add name="OracleDbContext" providerName="Oracle.ManagedDataAccess.Client"
  63. connectionString="User Id=hr;Password=hr;Data Source=MyDataSource"/>
  64. </connectionStrings>
  65. After following these instructions, ODP.NET, Managed Driver for Entity Framework is now configured and ready
  66. to use.
  67. NOTE: ODP.NET, Managed Driver may require its own configuration. Please consult the component's README
  68. at packages\Oracle.ManagedDataAccess.<version>.
  69. Installation Changes
  70. ====================
  71. The following app/web.config entries are added by including the "Official Oracle ODP.NET, Managed Entity Framework Driver"
  72. NuGet package to your application.
  73. 1) Entity Framework
  74. The following entry is added to enable Entity Framework to use Oracle.ManagedDataAccess.dll for executing Entity
  75. Framework related-operations, such as Entity Framework Code First and Entity Framework Code First Migrations against
  76. the Oracle Database.
  77. <configuration>
  78. <entityFramework>
  79. <providers>
  80. <provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
  81. </providers>
  82. </entityFramework>
  83. </configuration>
  84. 2) Connection String
  85. The following entry is added to enable the classes that are derived from DbContext to be associated with a connection
  86. string instead to associating the derived class with a connection string programmatically by passing it via its
  87. constructor. The name of "OracleDbContext" should be changed to the class name of your class that derives from DbContext.
  88. In addition, the connectionString attribute should be modified properly to set the "User Id", "Password", and
  89. "Data Source" appropriately with valid values.
  90. <configuration>
  91. <connectionStrings>
  92. <add name="OracleDbContext" providerName="Oracle.ManagedDataAccess.Client" connectionString="User Id=oracle_user;Password=oracle_user_password;Data Source=oracle" />
  93. </connectionStrings>
  94. </configuration>
  95. Documentation Corrections and Additions
  96. =======================================
  97. None
  98. Entity Framework Tips, Limitations, and Known Issues
  99. ====================================================
  100. This section contains Entity Framework related information that pertains to both ODP.NET, Managed Driver and ODP.NET,
  101. Unmanaged Driver.
  102. 1. Interval Day to Second and Interval Year to Month column values cannot be compared to literals in a WHERE clause of
  103. a LINQ to Entities or an Entity SQL query.
  104. 2. LINQ to Entities and Entity SQL (ESQL) queries that require the usage of SQL APPLY in the generated queries will
  105. cause SQL syntax error(s) if the Oracle Database being used does not support APPLY. In such cases, the inner exception
  106. message will indicate that APPLY is not supported by the database.
  107. 3. ODP.NET does not currently support wildcards that accept character ranges for the LIKE operator in Entity SQL
  108. (i.e. [] and [^]). [Bug 11683837]
  109. 4. Executing LINQ or ESQL query against tables with one or more column names that are close to or equal to the maximum
  110. length of identifiers (30 bytes) may encounter "ORA-00972: identifier is too long" error, due to the usage of alias
  111. identifier(s) in the generated SQL that exceed the limit.
  112. 5. An "ORA-00932: inconsistent datatypes: expected - got NCLOB" error will be encountered when trying to bind a string
  113. that is equal to or greater than 2,000 characters in length to an XMLType column or parameter. [Bug 12630958]
  114. 6. An "ORA-00932 : inconsistent datatypes" error can be encountered if a string of 2,000 or more characters, or a byte
  115. array with 4,000 bytes or more in length, is bound in a WHERE clause of a LINQ/ESQL query. The same error can be
  116. encountered if an entity property that maps to a BLOB, CLOB, NCLOB, LONG, LONG RAW, XMLTYPE column is used in a WHERE
  117. clause of a LINQ/ESQL query.
  118. 7. An "Arithmetic operation resulted in an overflow" exception can be encountered when fetching numeric values that
  119. have more precision than what the .NET type can support. In such cases, the LINQ or ESQL query can "cast" the value
  120. to a particular .NET or EDM type to limit the precision and avoid the exception. This approach can be useful if the
  121. LINQ/ESQL query has computed/calculated columns which will store up to 38 precision in Oracle, which cannot be
  122. represented as .NET decimal unless the value is casted.
  123. 8. Oracle Database treats NULLs and empty strings the same. When executing string related operations on NULLS or empty
  124. strings, the result will be NULL. When comparing strings with NULLs, use the equals operator (i.e. "x == NULL") in the
  125. LINQ query, which will in turn use the "IS NULL" condition in the generated SQL that will appropriately detect NULL-ness.
  126. 9. If an exception message of "The store provider factory type 'Oracle.ManagedDataAccess.Client.OracleClientFactory'
  127. does not implement the IServiceProvider interface." is encountered when executing an Entity Framework application with
  128. ODP.NET, the machine.config requires and entry for ODP.NET under the <DbProviderFactories> section. To resolve this
  129. issue by adding an entry in the machine.config, reinstall ODAC.
  130. 10. Creating a second instance of the context that derives from DbContext within an application and executing methods
  131. within the scope of that context that result in an interaction with the database may result in unexpected recreation of
  132. the database objects if the DropCreateDatabaseAlways database initializer is used.
  133. More Informations: https://entityframework.codeplex.com/workitem/2362
  134. Known Workarounds:
  135. - Use a different database initializer,
  136. - Use an operating system authenticated user for the connection, or
  137. - Include "Persist Security Info=true" in the connection string (Warning: Turning on "Persist Security Info" will cause
  138. the password to remain as part of the connection string).
  139. Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.