NHibernate and Sql Dialect Driver for SQL Server 2014

We have an application that runs on NHibernate.3.3.3.4001 .

We decided to upgrade from SQL Server 2008 R2 to SQL Server 2014.

Previously, we had the following smooth configuration:

var databaseConfiguration = MsSqlConfiguration.MsSql2008.ConnectionString(connectionString) .Dialect<MsSql2008Dialect>(); databaseConfiguration = databaseConfiguration.Driver<Sql2008ClientDriver>(); 

I tested that the application works fine with this configuration when I connect to the SQL Server 2014 database instance.

  • How is it possible that I can use the 2008 driver and dialect while connecting to the 2014 database?

  • Are there any future complications that I miss?

  • Is there support for the driver and dialect 2014 in the higher version of NHibernate?

+5
source share
1 answer

The following functions depend on the dialect used.

  • Paging instead of using the built-in SKIP / TAKE function that MSSQL 2012 and above has, paging is emulated by a subquery that generates numbers for all returned rows. This is a backup that does not perform the method of creating its own function.
  • Sequences, MSSQL 2012 and higher now have the same function as Oracle. You can create a named sequence that generates increasing numbers. This is used by NHibernate extended generators to generate PK for inserted rows.

Question No. 1: Since MSSQL 2008 has fewer features, and MSSQL 2012 adds new features, you can use an older driver.

Question No. 2: You release some of the options described above.

Question No. 3: NHibernate 4.0 adds MSSQL 2012, currently there is no dialect for MSSQL 2014. This is definitely not a big problem, as many of the functions of MSSQL 2014 are not related to OR-Mapper and are not related to them.

+7
source

Source: https://habr.com/ru/post/1210906/


All Articles