November 2008 Entries

Type analyzer - Interesting findings

When reading this post from Ayende I was getting curious what this site would tell about my blogging style here. The result is amusing me a lot. INTJ - The Scientists The long-range thinking and individualistic type. They are especially good at looking at almost anything and figuring out a way of improving it - often with a highly creative and imaginative touch. They are intellectually curious and daring, but might be physically hesitant to try new things. The Scientists enjoy theoretical work that allows them to...

posted @ Sunday, November 30, 2008 9:39 PM | Feedback (546)

Linq to NHibernate

The popularity of NHibernate is steadily increasing. At the same time people get used to LINQ. Now there exists a LINQ to NHibernate provider since quite some time. It's not a complete implementation of a LINQ provider but it is still quite useful. Most of the day to day problems we face when developing typical business application can be solved by using this provider. And if there is a query that cannot be executed against the provider we still have the option to falling back to the hibernate query language (HQL). In this post I'll give you...

posted @ Wednesday, November 26, 2008 5:13 AM | Feedback (789)

Legacy DB and one-to-one relations

When dealing with a legacy database one often encounters the situation that the database schema defines one-to-one relations between two entities. A typical example might be the following schema fragment with a one-to-one relation between person and address, that is: each person can have an address and an address can only belong to a single person. To guarantee that a single person can only have zero or one address the foreign key column PersonId in the Address table is set to be unique. Such a construct is not straight forward to map in NHibernate! I...

posted @ Tuesday, November 18, 2008 10:17 PM | Feedback (461)

Lazy loading BLOBS and the like in NHibernate

[Updated, 2008-11-20 --> see end of post] One of the questions that is asked again and again in the NHibernate user mailing list is the question about whether NHibernate supports lazy-loading of properties. The answer is NO - at least for the time being. Why is this question reasonable? Well, often we have entities in our domain that contain fields with large amount of data. Some samples are a large binary object (BLOB, e.g. an image, a Word document, a PDF, etc.), a large text object (CLOB, or nvarchar(max) )...

posted @ Monday, November 17, 2008 12:23 AM | Feedback (709)

First and Second Level caching in NHibernate

I'll try to dive deep into the caching of NHibernate in this article. This post has been inspired by the talk given by Oren Eini (aka Ayende) at the Kaizen Conference in Austin TX. Caching is a topic that is IMHO only superficially described so far especially regarding the second level cache. Most of the time one finds a lot of information about how to configure a specific cache provider for usage but the real usage (who and when) is not really described. I hope to be able to provide some of the missing pieces with this post....

posted @ Sunday, November 09, 2008 5:57 AM | Feedback (963)