-
I was trying to profile some NHibernate sql to see if we could make some improvements. One thing I noticed very shortly after starting this task was that one of my columns was being duplicated. Now this is NOT going to make a huge performance difference but was something I wanted to...
-
When you are setting up your NHibernate mappings you must pay close attention to the way you setup your relationships between your entities. Recently I started profiling some of our statements and was shocked to see how some of them had a metric-crap ton of joins when they only needed one or two...
-
Today as I was creating a new NHibernate Criteria statement everything was working fine UNTIL I added the where clause. At this point I started to get the following exception (which was seen via NHibernate Profier ). WARN: System.Data.SqlClient.SqlException: The multi-part identifier "doc2_...
-
I’m a big fan of Linq. The more I learn about functional programming, the more I love (and use) Linq. However with any higher level abstraction there is the possibility of the mysterious inner workings differing from your intuitive expectations. (This one of the dangers of frameworks being ‘too helpful...
-
(Update: Added the code to initialize Castle Windsor as well) I've known about LINQPad for a long time but for some reason the usefulness of it just hit me yesterday. In a moment of clarity I plopped my money down for all the bells and whistles and started playing. I watched the video on the LINQPad...
-
Following Kevin Pang’s request on my last post regarding my problems getting NHibernate, NH Spatial and SQL Server Fulltext queries to work , I am finally getting around to giving some tips and pointers, and the code that Steve Strong of iMeta knocked up for me. I needed to get these things working...
-
I’m a huge fan of NHibernate . It has excellent documentation and just makes the whole job of getting things into and out of the database much more enjoyable. There is a whole series of posts on NHibernate from one of the committers, Ayende . When Fluent NHibernate (FNH) came out, it was...
-
Composite IDs are a common pain point a beginning NHibernate user runs into. Here's everything you need to get them up and running. First, a caveat: composite keys are certainly mappable in NHibernate, but it's a little trickier than a typical single identity key would be. Compared to a normal...
-
There are times, when you just think something should work, and one way or another it just doesn't. I've been having one of those weeks with NHibernate. I have been using MS SQL Server 2008 spatial searching, along with SQL Server Full text search, and using NHibernate for almost all my data...
-
I recently implemented a reporting model in my app (a windows service) and so now have two session factories to manage within a unit of work. Originally, I was using this setting: <property name="current_session_context_class"> thread_static </property> This was causing the wrong...
-
Yesterday, I spent some time setting up and optimizing SysCache2 caching. (By the way, if you're doing this kind of NHibernate tuning, NHProf - a devlicio.us friend - is crucial, it would have definitely been a much tougher slog without it) With caching turned on, one of our previously well-functioning...
-
Today I was working on some persistence code and quickly put together some code like the following: Post Updated: Had the wrong code the first time. public HealthStatus SetStatusEntry( Int32 statusTypeId, DateTime statusDateTime ) { var healthStatus = new HealthStatus() { StatusTypeId = statusTypeId...
-
UPDATE 1: I made clear that NH actually performs better in those posts, when a simple optimization such as Enabled Batching. UPDATE 2: Please check Ayende's latest post for how those benchmarks can be made fair. I am a bit late to the party but there we go. Last several days, there have been a hot...
-
As nice as SQLite is for tests it is very simple database, and it does not have all the features ‘big’ databases provide (foreign key enforcement!). I don’t think there’s much you can do about this issue, but there’s more. SQLite does not support all the mappings you can have. I bumped into this issue...
-
Disclaimer: I’m quite new to NHibernate. I’m just learning it, so do not assume that what I’m presenting here is a good idea, or that I know what I’m doing. You have been warned. There does not seem to be too much details on how to set up a test environment for NHibernate testing using SQLite. Ayende...