Oracle 实体框架兼容提供程序的比较?

发布于 2024-12-14 00:07:16 字数 1481 浏览 2 评论 0原文

我读过类似的问题及其答案,但是,除了一个已经过时的问题(从 2009 年 - EF4 之前)之外,似乎没有一个问题涉及这个确切的问题。

有人对 Oracle 的 EF 提供商有过正面或负面的体验吗?如果有的话,您的体验如何?

类似问题:
实体框架和 Oracle
您可以将 Microsoft Entity Framework 与 Oracle 结合使用吗?
带有 Oracle 数据库的实体框架
如何为 .Net 应用程序选择 Oracle 提供商?

我知道的提供商:
Oracle 的 ODP.NET:http://www.oracle.com/technetwork /topics/dotnet/index-085163.html
Devart 的 DotConnect:http://www.devart.com/dotconnect/entityframework.html
DataDirect 的进展:http://www.datadirect.com/products/net/release -history.html
OPENLINK: http://uda.openlinksw.com/dotnet/

我知道 Oracle 的提供程序当前处于 beta (3) 状态,并且未完全托管 - 32 位与 64 位的二进制文件不同。

其他的稳定吗?
有没有我错过的?
哪些已在您的项目中成功使用?

I have read similar questions and their answers, however, it seems none deal with this exact question except for one, which is out of date (from 2009 - pre EF4).

Does anyone have any positive or negative experience with EF providers for Oracle, if so what is your experience?

Similar questions:
Entity Framework and Oracle
Can you use Microsoft Entity Framework with Oracle?
Entity framework with oracle database
How to choose an Oracle provider for .Net application?

Providers I know of:
Oracle's ODP.NET: http://www.oracle.com/technetwork/topics/dotnet/index-085163.html
Devart's DotConnect: http://www.devart.com/dotconnect/entityframework.html
DataDirect's Progress: http://www.datadirect.com/products/net/release-history.html
OPENLINK: http://uda.openlinksw.com/dotnet/

I know that Oracle's provider is currently beta (3) and is not fully managed - separate binaries for 32bit vs 64bit.

Are any of the others stable?
Are there any that I have missed?
Which have been successfully used in your projects?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

剑心龙吟 2024-12-21 00:07:16

我对不同的提供商进行了快速比较,包括:

  1. 安装体验。
  2. 连接性。
  3. 服务器资源管理器体验。
  4. 根据数据库经验进行更新(数据库优先)。
  5. 数据类型映射(数据库优先)。

结论如下:

1.安装体验。

Oracle的ODP.NET(beta 3):
单独的 x86 和 x64 版本的复杂安装,安装程序不是为 Windows 设计的。
填充系统路径(危险地接近最大长度),不安装到标准文件夹(程序文件+应用程序数据)。

Devart 的 DotConnect:
安装顺利,提供者DLL完全托管。

DataDirect 的进展:
安装顺利,提供者DLL完全托管。

打开链接:
好像需要服务器端安装,没有进一步测试。

2.连接性。

Oracle 的 ODP.NET(测试版 3):
配置复杂,需要在客户端计算机上安装 Oracle 以及 Oracle 安装中的附加 TSN 文件或看起来像 LISP/Scheme 的长而复杂的连接字符串。
更新: 在文档中找不到此内容,但是,连接字符串也可以包含简单的数据源定义,例如 serverName:port/serviceName。

Devart 的 DotConnect:
简单的连接字符串+向导。

DataDirect 的进展:
简单的连接字符串+向导。

3. Server Explorer 体验。

Oracle 的 ODP.NET(测试版 3):
三者中功能最强大的,可以轻松编辑、查看键和索引。

Devart 的 DotConnect:
查看表和字段。

DataDirect 的进展:
可以轻松编辑、查看键和索引。

4.根据数据库经验进行更新(数据库优先)。

Oracle 的 ODP.NET(测试版 3):
直截了当。

Devart 的 DotConnect:
显示所有模式中的表,没有过滤选项 - 使查找表变得很累。

DataDirect 的进展:
直截了当。

5.数据类型映射(数据库优先)。

Oracle 的 ODP.NET(测试版 3):
number(1,0)、number(2,0) 和 number(3,0) 的默认映射是错误的*。
可以手动覆盖 number(2,0) 和 number(3,0)。修复 number(1,0) 不起作用(至少在 beta 3 上不起作用 - 可能在 beta 2 中起作用)。

更新: 现在发布版本已发布 (112030),此问题已得到修复。
某些映射可以通过app.config 文件中的部分实现。

Devart 的 DotConnect:
显示所有模式中的表,没有过滤选项 - 使查找表变得很累。
二进制浮点型、二进制双精度型、带时区的时间戳、number(2,0)、number(3,0) 和 number(4,0) 的默认映射是错误的*。手动覆盖应该可以工作 - 没有检查。

DataDirect 的进展:
默认映射没问题*。

(*)我期望的映射:

DB Data Type    .NET Data Type
integer     Decimal
int         Decimal
smallint        Decimal
long        String
decimal     Decimal
rowid       String
float       Decimal
double      Decimal
binary float    Single
binary double   Double
char[40]        String
charvar[40]     String
natchar[40]     String
natcharvar[40]  String
natcharacter[40]    String
natcharactervar[40] String
number      Decimal
numeric     Decimal
nvarchar2[40]   String
real        Decimal
date        DateTime
timestamp       DateTime
timestamplocal  DateTime
timestampzone   DateTimeOffset
xml String
raw15       Binary
raw16       Guid
raw17       Int64
number(1,0)     Boolean
number(2,0)     Byte or SByte
number(3,0)     Byte or SByte (accepted Int16 as OK too)
number(4,0)     Int16
number(5,0)     Int16 (accepted Int32 as OK too)
number(6,0)     Int32
number(7,0)     Int32
number(8,0)     Int32
number(9,0)     Int32
number(10,0)    Int32 (accepted Int64 as OK too)
number(11,0)    Int64
number(15,0)    Int64
number(16,0)    Int64
number(17,0)    Int64
number(18,0)    Int64
number(19,0)    Int64 (accepted Decimal as OK too)
number(20,0)    Decimal (would accept Int64 as OK too)
number(21+,0)   Decimal

如果您希望数据库类型能够存储 .NET 类型范围内的任何数字,那么
IntX 需要一个数字(N,0),其中 Ceil(log10(2^X)) = N 用于存储**。

Bool (Int1) ==> number(1,0)
Byte (Int8) ==> number(3,0)
Int16, UInt16 ==> number(5,0)
Int32, UInt32 ==> number(10,0)
Int64 ==> number(19,0)
UInt64 ==> number(20,0)

** 计算假设无符号数,对于有符号数 ceil(log(2^(X-1))。

数据类型假设参考:
网络技术
Devart
Oracle

I ran a quick comparison of the different providers consisting of:

  1. Installation experience.
  2. Connectivity.
  3. Server Explorer experience.
  4. Updating from database experience (database first).
  5. Data type mappings (database first).

Here are the conclusions:

1. Installation experience.

Oracle's ODP.NET (beta 3):
Complex installation of separate x86 and x64 versions, installers not designed for Windows.
Fills system path (dangerously close to max length), does not install to standard folders (program files + appdata).

Devart's DotConnect:
Smooth installation, provider DLL is fully managed.

DataDirect's Progress:
Smooth installation, provider DLL is fully managed.

OPENLINK:
Seems to require server side installation, did not test further.

2. Connectivity.

Oracle's ODP.NET (beta 3):
Complicated to configure, requires Oracle installation on client machine and either additional TSN file in Oracle installation or a long and complex connection string that looks like LISP/Scheme.
Update: Couldn't find this in the documentation, however, connection string can also contain simple data source definition e.g. serverName:port/serviceName.

Devart's DotConnect:
Simple connection string + wizard.

DataDirect's Progress:
Simple connection string + wizard.

3. Server Explorer experience.

Oracle's ODP.NET (beta 3):
Most powerful of the three, enables easy editing, viewing of keys and indexes.

Devart's DotConnect:
Viewing of tables and fields.

DataDirect's Progress:
Enables easy editing, viewing of keys and indexes.

4. Updating from database experience (database first).

Oracle's ODP.NET (beta 3):
Straightforward.

Devart's DotConnect:
Shows tables from all schemas, no option to filter - makes finding tables exhausting.

DataDirect's Progress:
Straightforward.

5. Data type mappings (database first).

Oracle's ODP.NET (beta 3):
Default mapping for number(1,0), number(2,0) and number(3,0) are wrong*.
Can manually override for number(2,0) and number(3,0). Fixing for number(1,0) doesn't work (at least not on beta 3 - may have worked in beta 2).

Update: Now that the release version is out (112030) this has been fixed.
Some mappings are possible via section in app.config file.

Devart's DotConnect:
Shows tables from all schemas, no option to filter - makes finding tables exhausting.
Default mapping for binary float, binary double, timestamp with time zone, number(2,0), number(3,0) and number(4,0) are wrong*. Manual override should work - didn't check.

DataDirect's Progress:
Default mappings are OK*.

(*) Mappings I expected:

DB Data Type    .NET Data Type
integer     Decimal
int         Decimal
smallint        Decimal
long        String
decimal     Decimal
rowid       String
float       Decimal
double      Decimal
binary float    Single
binary double   Double
char[40]        String
charvar[40]     String
natchar[40]     String
natcharvar[40]  String
natcharacter[40]    String
natcharactervar[40] String
number      Decimal
numeric     Decimal
nvarchar2[40]   String
real        Decimal
date        DateTime
timestamp       DateTime
timestamplocal  DateTime
timestampzone   DateTimeOffset
xml String
raw15       Binary
raw16       Guid
raw17       Int64
number(1,0)     Boolean
number(2,0)     Byte or SByte
number(3,0)     Byte or SByte (accepted Int16 as OK too)
number(4,0)     Int16
number(5,0)     Int16 (accepted Int32 as OK too)
number(6,0)     Int32
number(7,0)     Int32
number(8,0)     Int32
number(9,0)     Int32
number(10,0)    Int32 (accepted Int64 as OK too)
number(11,0)    Int64
number(15,0)    Int64
number(16,0)    Int64
number(17,0)    Int64
number(18,0)    Int64
number(19,0)    Int64 (accepted Decimal as OK too)
number(20,0)    Decimal (would accept Int64 as OK too)
number(21+,0)   Decimal

If you want the database type to be able to store any number in the .NET type range then
IntX requires a number(N,0) where Ceil(log10(2^X)) = N for storage**.

Bool (Int1) ==> number(1,0)
Byte (Int8) ==> number(3,0)
Int16, UInt16 ==> number(5,0)
Int32, UInt32 ==> number(10,0)
Int64 ==> number(19,0)
UInt64 ==> number(20,0)

** Calculation assumes unsigned numbers, for signed numbers ceil(log(2^(X-1)).

References for data type assumptions:
TECH on the Net
Devart
Oracle

维持三分热 2024-12-21 00:07:16

我还没有尝试过应该支持最新数据提供程序的 EF 4.2,由于有许多新功能插件,4.1 仅支持 MS SQL 提供程序。

以下是列出的所有提供商
http://blogs.msdn .com/b/adonet/archive/2011/11/01/ef-4-2-released.aspx

EF 4.2 仅作为 NuGet 包提供,应该是稳定的,我是在生产中使用 4.1(Asp.Net MVC 和 MS SQL Server)

另外,以下是一些与您的问题类似的先前答案:
支持实体框架的 Oracle 提供程序 ( msdn)

简而言之,如果您使用的是 Entity Framework 4.1,您应该更新,您可能会遇到严重的核心问题与它。
升级到 4.2,然后再次测试,一切都应该与提供商一起正常工作。

例如,dotConnect for Oracle 支持实体框架 v4,因此无需EF 4.2 中的问题

I haven't tried EF 4.2 which should have support for the latest data providers , 4.1 only has support for the MS SQL Providers due the numerious new feature addons.

Here are all providers listed
http://blogs.msdn.com/b/adonet/archive/2011/11/01/ef-4-2-released.aspx

EF 4.2 is only available as NuGet package and should be stable, i'm using 4.1 in production (Asp.Net MVC and MS SQL Server)

Also, here are some previous answers similar to your question:
Support Oracle Provider for Entity Framework (msdn)

Short, if you are using Entity Framework 4.1, you should update, you could have severe core problems with it.
Upgrade to 4.2 and then test again, everything should work fine with the providers.

dotConnect for Oracle for example has support for Entity Framework v4, so this will work without problems in EF 4.2

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文