What an event! Round about 300 people met at the Holiday Inn - Am Stadtwald, Cologne. And I am sure, none of them regrets his participance.

Some of the sponsors were present with exhibition stands. For me, that was informative and useful; e.g. I took home some information about a WPF control collection which could help us to solve a problem we a currently facing in my company.

I really like these community conferences. The information given there are absolutely useful for the daily work for the speakers take their topics “from life”. Additionally, it is nice to share experiences with other participants.

dotnetCologne2010The dotnet Cologne this year was held on the occasion of the launch of Visual Studio 2010 and the .NET framework 4. So, the talks, which were organised in altogether 30 sessions and 4 tracks, more or less dealt with these two aspects. That was a quite condensed programme. Even the lunch break was used for sessions! I was this time mostly interested in parallel programming, code contracts, and some goodies of the new .NET framework.

As last year, the sessions were great due to the high expertise of the speakers! The whole conference gave you the feeling of bringing you to the technological state of the art.

What was the benefit at the end of the day? First contact to new technologies or a deeper insight into it, new programming techniques, hints for your daily work - just to name a few.

Of course, there was a raffle at the end of the conference. And you may guess right that I was one of the numerous winners - this time, it was a book.

Not only from my point of view, the conference was a great success. Thanks to the organisation team - absolutely well done (again)!

,

Today, I attended the dotnet Cologne 2009. It was a one-day community conference (in German) on WPF and Silverlight.

About 180 people gathered at the Microsoft building in Cologne. They were presented a very good programme. The speakers were great, the topics of the talks were great, too. The talks were arranged on two tracks most of the time.

For me, it was a quite valuable event. I gained a lot of practical insights into WPF and Silverlight. In particular, the talk on the data binding mechanism in WPF attracted my special interest. As usual, the discussions with the participants during the breaks were interesting as well as inspiring.

In addition, which made the day valuable for me in terms of money or development tools, I won a ComponentOne Studio Enterprise licence from the closing raffle. :-)

Thanks to the organisers and I’m looking forward to the dotnet Cologne next year!

, ,

A few weeks ago, we started to use a new tool by Ayende: The NHibernate Profiler (currently beta). It is a real-time debugger to debug and improve the usage of NHibernate in our modules.

The NHibernate Profiler provides a lot of valuable (technical and statistical) data on the current activity:

  • SQL statements per session with additional information: Details, stack trace, and alerts. Alerts are some warnings which Ayende explains on his website.
  • A session usage report: Number of entities loaded, entities loaded, duration, etc.
  • A session analysis, e.g. View by Method which displays all SQL statements generated by a particular method of a module.
  • Statistics not only on the sessions, but also on the session factory.

We have used it several times to see, what our modules using NHibernate internally do. In particular, the alert information have been extremely valuable for us.

Obviously, there are still some minor bugs in the beta version of the tool. For example, we get a Use of implicit transactions is discouraged alert although we only have explicit transactions.

Usage

In order to debug an application, the client for monitoring the activity has to be started. This client provides all the information explained above.

The best way to make your application communicate with the client is to use log4net, for the application (and the solution/project) does not need to be changed in any way in this case (provided that you already use log4net in your application). Just add an appender in the log4net.config file and make the required loggers use that appender.

Example:

<appender name="NHibernate.Profiler" type="HibernatingRhinos.NHibernate.Profiler.Appender.NHibernateProfilerAppender, HibernatingRhinos.NHibernate.Profiler.Appender" >
  <sink value="tcp://localhost:22897/NHibernateAppenderLoggingSink" />
</appender>
 
<logger name="NHibernate.Transaction.AdoTransaction">
  <level value="DEBUG"/>
  <appender-ref ref="NHibernate.Profiler"/>
</logger>
<logger name="NHibernate.Loader.Loader">
  <level value="DEBUG"/>
  <appender-ref ref="NHibernate.Profiler"/>
</logger>
<logger name="NHibernate.SQL">
  <level value="DEBUG"/>
  <appender-ref ref="NHibernate.Profiler"/>
</logger>
<logger name="NHibernate.Impl.SessionImpl">
  <level value="DEBUG"/>
  <appender-ref ref="NHibernate.Profiler"/>
</logger>
<logger name="NHibernate.Persister.Entity.AbstractEntityPersister">
  <level value="DEBUG"/>
  <appender-ref ref="NHibernate.Profiler"/>
</logger>

As this example shows, the profiler appender class has to be referenced and a TCP sink for the communication with the client has to be declared. The defined loggers redirect the required information to the profiler. Finally, the DLL containing the profiler appender class has to be stored in the application directory. That’s all. When running the application, the NHibernate activities are monitored by the client.

You can (and due to the licence, you probably must) ship your application without the profiler appender class DLL. There is no need to modify the log4net.config file, though. The profiler appender does not have to be removed. log4net just complains (within its log file), that the particular appender could not be instantiated (because it was not found). If you do not want that message in the log file, you have to ship your application with a log4net.config which does not contain the profiler appender.

Another way to use the profiler is to reference the HibernatingRhinos.NHibernate.Profiler.Appender.dll and make the following call within the application startup:

HibernatingRhinos.NHibernate.Profiler.Appender.NHibernateProfiler.Initialize();

But as this means a change of the application code and requires a reference within the project, I do prefer the first kind of usage. Additionally, the application cannot be shipped when modified in this way. (Remember, you may not ship the profiler appender class DLL with your application.)

,