NHibernate 4000 Character Limit, Sigh…

Summary NHibernate has its share of issues. One of it’s most notorious issues is the 4000 character limit. That limit reveals itself when you attempt to write to text or VARCHAR fields in your database that exceed that limit. In this post, I’m going to describe some solutions to this problem. Mappings One issue shows … Read moreNHibernate 4000 Character Limit, Sigh…

Creating a Windows Service Application

Summary In this post, I’m going to show you the easiest way to get a service application up and running. Windows Services can be used to perform background tasks while your computer or server continues to perform normal tasks. Services can also run while a computer is logged out. Getting Started The first thing I … Read moreCreating a Windows Service Application

How to detect if your code was called from a unit test

I’ve done a few unit test blog posts, but this time I’m going to demonstrate how to detect if a method is running under a unit test. This flag can be used to break dependencies in an object or run a test database instance instead of the production instance. The first article I stumbled across … Read moreHow to detect if your code was called from a unit test

SQLLocalDB Fast Unit Tests

Summary One of my previous posts described how to setup a MS SQL Lite server called LocalDB. My little demo project worked really good except for one detail. It was slow. The primary problem was that I was starting the instance, creating the database in the unit test initialize (called [TestInitialize]) and then I was … Read moreSQLLocalDB Fast Unit Tests

Fluent NHibernate “Not Supported By” Exception

Summary So my company has successfully switched to using Fluent NHibernate for our production systems. So far the results are astounding. One thing our developers have learned is that there is no “perfect” ORM. Not yet anyway. Each seems to have a flaw or two. NHibernate has a couple of issues that can be worked … Read moreFluent NHibernate “Not Supported By” Exception

Unit Testing Fluent NHibernate

Summary I’ve covered a little unit testing of NHibernate in the past. I showed how to use SQLite, which is the most common method of unit testing (technically, integration testing) an NHibernate application. If you’re using MS SQL server for your application, SQLite has some serious limitations that could hinder your unit tests. So I’m … Read moreUnit Testing Fluent NHibernate

Fluent NHibernate Subquery Stuff

Summary I was converting some Entity Framework Linq to use NHibernate when I came across a strange error. At first I was baffled by the error message because it was telling me that there were too many input parameters. Doing an internet search led me to articles about how to limit the number of parameters … Read moreFluent NHibernate Subquery Stuff

Fluent NHibernate More Stored Procedures Without Mapping

I did a sample post on how Fluent NHibernate executes a stored procedure, but I didn’t dig into the subject and show some details. The sample I showed returned a list of tables that were already mapped and it made the whole sample easy, but not realistic. In most cases we want to execute a … Read moreFluent NHibernate More Stored Procedures Without Mapping