NHibernate has a lot of interesting and specific option for mapping entities that can really cover every scenario you have in mind, but you need to be aware of every implication each advanced option has on performances. If you are in a legacy-database scenario where entity A reference Entity B, but someone outside the control […]

Continue reading about Relations with not-found=”ignore” disable lazy load and impact on performances

In version 3.2 of NHibernate a new mapping capabilities was introduced to easy mapping of entities in your project. To understand how it works and how easy it is here it is all initialization code you need if you want to accept default mapping rules for all of your classes. Basically I’m creating a ConvetionModelMapper […]

Continue reading about NHibernate 3.2 and Mapping By Code

I’ve already blogged in the past on how to easily troubleshoot WCF Exception and that suggestion is valid for every exception you encounter in WCF. Today I have a function that gave the error System.ServiceModel.CommunicationException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. —> […]

Continue reading about Troubleshoot WCF The underlying connection was closed: A connection that was expected to be kept alive was closed by the server

When you work with ORM like nhibernate, having a tool like nhprof is the key of success. But even with NHProfiler you could not prevent people of doing wrong stuff because they do not use it :). I have a simple scenario, a developer changed a method on the server lazily fetching a property of […]

Continue reading about Unit test NHibernate query to verify N+1

Custom XML Serialization
on December 1st, 2011
On category: Nhibernate

Another advantage of storing properties of entities into a state object based on a Dictionary, is the ability to easily serialize objects in custom formats. As an example I create an XML serializer that is capable to serialize an entity in a custom XML format. I used this simple serializer to create a NHibernate User […]

Continue reading about Custom XML Serialization