开发者

DataBase support in NHibernate vs Entity Framework 4.1

I am investigating for different ORMs to use in a new Web Application I have to develop.

I hesitate between NHibernate and EntityFramework 4.1.

I know that NHibernate does support different databases (like SQL Server, MySQL, Oracle, and so on开发者_运维百科.) isn't it?

What about Entity Framework? I cannot find which databases it supports (I suppose it is database agnostic but I am not very sure). For example, I was not able to make it run with MySQL (with MySQL Connector 6.4.3).

The answer I want is only regarding on the support of differents databases. There are some information in stackoverflow about "NHibernate vs Entity Framework".


Entity Framework query is translated into final form (sent to DB) by three "layers":
1. Object Services
2. EntityClient Data Provider
3. ADO .NET Data Provider.
The Object Services layer is a component of the Entity Framework that enables you to query, insert, update, and delete data, using common language runtime (CLR) objects that are instances of entity types.
The Entity Framework includes the EntityClient data provider, which manages connections, translates entity queries into data source-specific queries, and returns a data reader the Entity Framework uses to materialize entity data into objects.
Traditional ADO.NET is still used to communicate to the underlying database.

What does it mean? It means Entity Framework was designed to be database independed. You can use it with every database if database provider has created provider for ADO .NET (which exists for MySQL, Oracle etc.).
For MySQL you should be able to use EF with connector that you've mentioned (more info: http://dev.mysql.com/doc/refman/4.1/en/connector-net-visual-studio-entity-framework.html)


Out of the box NHibernate supports following:

  • Microsoft SQL Server (including Compact Edition)
  • Oracle
  • Microsoft Access
  • Firebird
  • PostgreSQL
  • DB2 UDB
  • MySQL
  • SQLite

Corresponding ADO.NET provider needs to be installed. In addition to ADO.NET provider, NHibernate needs its own 'driver' and 'dialect' if you want to extend it to support the database that is not on the list.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜