Wednesday, May 28, 2008

First impressions with NHibernate 2.0

Almost two months ago, Ayenda Rahien announced the release of the first alpha of a new generation of NHibernate. NHibernate's feature set has always been a subset of the corresponding Java equivalent, Hibernate 3.x. With the new Nhibernate 2.0 release, the team has aligned its feature set with that of Hibernate 3.2. Its almost at the same level now.

In his announcement, Ayende also stated that this alpha version was tested thoroughly in a production environment. Due to Ayende's reputation, we decided to try it as well, and I must agree, other than the initial breaking changes, we did not run into any problems yet. Since the documentation is not up to date yet, we have not started using any of the new features, and limited the upgrade to getting the existing system running with 2.0 alpha 1. Some of the more noticeable things to take into account include:

  • You cannot wrap a binding variable in a lower() function anymore. I don't know why this has changed, but you now have to call ToLower() while passing the value to the SetParameter() method of IQuery.
  • The SysCache provider is no longer part of the NHibernate distribution. You have to get it from SourceForge yourself, but getting the sources is painfully difficult without using SubVersion. For your convenience, you can get a compiled version compatible with NH2.0 alpha 1 from here.
  • The IQuery.SetParameterList method has received an overload that takes an ICollection in addition to the one that takes an array. Consequently, the compiler will start to comply about ambiguous calls. You need to explicitly specify the overload you need.
  • The ValueValueType (from the NHibernate.Type namespace) has been phased out. We used it to create a custom NHibernate type that supports storing a boolean as a J/N character (Dutch for yes and no). The best alternative is the ImmutableType.
  • The NHibernate.Expression namespace has been renamed to NHibernate.Criterion
  • We use a modified connection provider that passes some additional information to the database whenever a connection is created. It requires a few configuration settings that we made part of the <hibernate> configuration section. NH 2.0's DriverConnectionProvider changes the Configure method from a IDictionary to a generic collection, and it has become very picky of the contents of the <hibernate> section (it validates it using an XSD). We had to move our configuration data to the <appSettings> section.
  • NH 2.0 will validate all named HQL and SQL queries when it's loading the mapping files. We discovered quite a few unused queries, so that was a nice side-effect.

Another aspect that makes this new version quite interesting is that the approaching release of the ADO.NET Entity Framework (now part of Visual Studio 2008 Service Pack 1 Beta) reveals that NHibernate easily wins on the feature and flexibility level. I myself was considering moving over to the Entity Framework whenever a suitable project passed by, but after having heard of the lack of lazy-loading support and the amount of impact it has on my domain model (the generated business classes), I'm not sure anymore. Hopefully the NHibernate team will continue with the LINQ-to-NHibernate project as soon as possible. Since Ayende seems to track blog posts referring to NHibernate, he may answer this question soon enough.

Thursday, May 22, 2008

Wilkommen in die welt von Schiller

Or...in English...Welcome to the world of Schiller. Say what?

Well, as a starter, take an excellent German composer/producer whose origins lay in the trance scene, add some elements from well known artists like Jean-Michel Jarre and Genesis, and finally, complement with awesome male and female vocalists such as Kim Sanders and Peter Heppner and you get the ultimate mix of pop, ambient, trance and lounge music. This more or less characterizes the music Christopher von Deylen produces under the name Schiller.

After having been a fan since he released his first album titled Zeitgeist in 1999, last week I finally went to see him performing at the Palladium in Cologne (Köln). Although my girlfriend is not a big fan, she does enjoy quite few of the more vocally oriented songs, so she was so kind to join me. Obviously, we used the concert as an opportunity to visit Köln again and luckily the city was having wine feasts that week :-)

clip_image001

Since the Palladium can handle an audience of 4000 people, you won't be surprised that the queue we had to wait in continued along the pavement for multiple blocks. Surprisingly, the Germans are not as blunt or bold as the Dutch and waited patiently. Nobody tried to get into the front of the line. Anyway, the concert was well worth the waiting.

For an ambient-style concert it was quite spectacular. Check out this video for some footage from last year's performance, although I do think that that video does not quite catch the power of the real performance. Christopher was accompanied by another keyboard player, two guitar players (both acoustic and electric) and two independent drummers. All added a specific touch to the original synthetic songs, but especially the electric guitar and the drummers playing in parallel added an unparallel twist to the already awesome Schiller music.

I know that this kind of music does not excite everybody, but for me, this was an unforgettable experience. And once again, my respect for musicians has increased significantly. If you want to find out more about Schiller, check out this website or look for some examples on YouTube.