Posts in nHibernate Categories

NHibernate with logging throws a Security Exception under Medium Trust

I am using NHibernate 3.2.0 under medium trust and all was going well until I turned on logging to try and trace a SQL error. It seems that when you set the log4net logging level to INFO that under a medium trust NHibernate throws a Security Exception. You can see from the stack trace exactly where the error was occurring, its quite clear. In the NHibernate source the static constructor for the Environment you can see that the NHibernate Version is logged, I was picking that is where the the error was occurring.

Problem getting log4net 1.2.10 working with ASP.Net 4

Just a quick note on getting log4net 1.2.10 working with ASP.Net 4. I had been working with log4net version in ASP.Net 3.5 and it had been working but after upgrading the project to ASP.NET 4 I noticed an odd behavior. It would log only one message to the log file and refused to log any further messages until the application was restarted.

Custom Domain using nHibernate dynamic-component

I have been working on providing a user defined domain object to my C# ASP.NET nHibernate project. I have been undecided on which approach to take. One difficulty is that the the mapping files I am using are embedded so they cannot be changed. After some research I had been considering two options. Using a one-to-many look up table which contained all the custom attributes or using a dynamic-component mapping.

Problems Migrating MSSQL to MySQL with NHibernate

Today I tried migrating my current project from using MSSQL Server to use MySQL Server. Theoretically this should be easy because my project uses NHibernate. As long as the structure of the MySQL database is the same as the MSSQL database I should be able to just change the NHibernate configuration

NHibernate vs OpenAccess ORM from Telerik

You have so many options when it comes to choosing a ORM these days. My personal favorite is nHibernate I have been using nHibernate for a few years now and I find it flexible really easy to use and has a growing community of users. Saying that I'm always on the lookout for something new which is where OpenAcess ORM form Telerik comes in, I use the Telerik RadControls for ASP.NET AJAX on some projects.I have always found it a good practice to minimize the number different 3rd party control vendors in an application. You usually have less problems integrating the controls and have a more consistent product.

NHibernate IQuery using a DTO class import mapping

As I had demonstrated in my previous post NHibernate SetResultTransformer and DTO using ICriteria to select across multiple classes or entities is straight forward. At the time I got stuck on how to do this using the IQuery interface and HQL, for some queries I find HQL is more flexible.

NHibernate SetResultTransformer and DTO

Lately I have been exploring NHibernate and ICriteria. NHibernate is great I would recommend it to anyone but often I find the documentation and examples are hard to follow. NHibernate SetResultTransformer combined with the generic list make returning a typed list from a complicated query really easy.

Problem with ICriteria when you want to order by a group using SqlGroupProjection

I wanted to do something that is fairly straight forward in plain SQL which was to order a query by one of the grouped columns.