Geeks With Blogs
Billy McCafferty whatever (but really just .NET) NHibernate
Using NHibernate with Multiple Databases
I've added a new article to concerning NHibernate with multiple databases with either ASP.NET or .NET. The article can be found at Any and all feedback is certainly welcome. As an addendum, Hector Cruz has described an approach to connecting to multiple DBs on the same server via NHibernate HBM files at Billy ......

Posted On Monday, July 17, 2006 8:34 PM

Model-View-Presenter with ASP.NET: An (almost) exhaustive examination
I've been working on an article for the past few weeks concerning the usage of the Model-View-Presenter pattern with ASP.NET. The article has been completed and uploaded to I hope you find this article useful. Please feel free to raise your questions and/or concerns. Billy ......

Posted On Sunday, July 2, 2006 8:22 PM

An alternative to "placeholder" Inheritance Mapping with NHibernate
Suppose you have a “Project” object that has 0 or more “Attachment” objects in your domain. (The Project class exposes an IList of Attachments and the Attachment has a reference to “ParentProject.”) Now you'd like to introduce a new object called “Cabinet” which can also have a number of attachments associated with it. (Cabinet also exposes an IList of Attachments.) The question is, how do we manage the relationship via NHibernate and within the database ......

Posted On Monday, April 24, 2006 12:43 PM

NHibernate Best Practices with ASP.NET, Generics & Unit Tests
I finally got around to it... the whole shebang of NHibernate best practices with ASP.NET and Generics. The article, along with the related source, can be found at Your review, feedback and suggestions would be much appreciated! 3/3/06 UPDATE I've updated the article on Code Project to include a unit testing project to show how to simulate the web context and how to create “mock” DAO objects within your unit tests ......

Posted On Saturday, March 11, 2006 10:22 PM

Giving NHibernate a serious performance boost
When NHibernate prepares SQL queries for SQL Server, it passes them to sp_execsql. Upon first call, the query speed is lackluster as it parses and executes the SQL; on subsequent calls with the same query syntax, the speed gets a bit faster. But even on subsequent calls, the response time is much slower than that of a stored procedure. The problem is, by default, NHibernate does not fully qualify table names within its queries sent to SQL Server. To leverage sp_execsql to its fullest, requests must ......

Posted On Wednesday, March 8, 2006 10:46 AM

Generic DAO with NHibernate
4/28/06 Update: The NHibernate article wins ASP.NET article of the month. Woohoo!3/14/06 Update: See how this is used in a sample application at has a great article on creating a generic DAO for Hibernate in Java. Below is what I use for the C# port. The interface for common CRUD functionality... public interface GenericDAO { T GetById(IdDataType id, bool shouldLock); List GetAll(); List GetByExample(T ......

Posted On Wednesday, February 15, 2006 7:32 AM

Copyright © Billy McCafferty | Powered by: