Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fluffynuts/ormnomnom

Simple comparison between Entity and NHibernate with a FluentMigrator spin-up, using SQLCE and Sqlite for testing purposes
https://github.com/fluffynuts/ormnomnom

Last synced: 5 days ago
JSON representation

Simple comparison between Entity and NHibernate with a FluentMigrator spin-up, using SQLCE and Sqlite for testing purposes

Awesome Lists containing this project

README

        

OrmNomNom
=========

Simple comparison between Entity and NHibernate with a FluentMigrator spin-up, using SQLCE and Sqlite for testing purposes
OrmNomNom notes:

1) When installing NHibernate, you probably want FluentNHibernate. Whilst
FluentNHibernate depends on NHibernate, it depends on version 3.3.something
or better, so nuget goes off and gets an old NHibernate. So install
NHibernate FIRST and then FluentNHibernate

2) FluentNHibernate requires that you exlicitly exclude classes which are not entities

3) NHibernate entities must have VIRTUAL properties

4) NHibernate sessions and session builders MUST be disposed to release
connections on the databases at hand

5) Side-note: SqlCe has a default policy on transaction disposal to ROLL BACK,
not COMMIT, so you MUST commit transactions if you ever get into SqlCe
land

6) If you are using SqlCe with Entity, make sure that the following entry has
been added to your (app|web).config:

the Nuget package *should* do it for you, but I've had it *not* do it for
me on occasion

7) if you do everything fluently with NHibernate, you shouldn't have to diddle
with the config

8) don't forget to reference system.data.sqlserverce & set to copy local

7) Entity packages: you need EF (duh) and the provider for your test db
backend (SqlCe or Sqlite); ensure that you have the relevant EF provider
confing in your (web|app).config (this config discovered through trial,
error, weeping, gnashing of teeth, StackOverflow, more trial, more error
and finally, a wild guess which worked:





















provider packages:
System.Data.Sqlite
EntityFramework.SqlServerCompact

8) Note that I provide a DbConnection for contexts within my tests because
otherwise entity gets confused about which provider to use, since I have
several defined in the config file. You may not have to follow this approach
if you only use one provider type

9) If you're using Sqlite for backing (file or in-memory) against Entity, you will have to
store integer values as LONGs since otherwise retrieval results in a failure as the
stored values are pulled up as int64 and then can't be applied to your int32 properties.