Caution with disposing session.Transaction

In nhibernate 1.2.0 beta versions a similar code path works well without problem

ISession session = SessionHelper.GetSession();
session.BeginTransaction();
//do something
session.Transaction.Rollback();
session.Transaction.Dispose();
session.BeginTransaction();
//Do something
session.Transaction.Rollback();

But above code is not legal since a disposed transaction cannot be used anymore. Until version 1.2.0 beta 3 the Dispose method of the Transaction Object did not mark transaction as disposed, so it can be reused. Starting from NHibernate 1.2.0 GA the above code will throw a NullReferenceException. The solution is not to dispose Session.Transaction if you plan to restart a new transaction again.

Alk.

When sql compare creates anger

I enabled session store in database in a test server, the application is ok and after some test I proceed to store the session in database even in the production site. I create a new session state database into the production server and I copy structure doing a synchronization with session state database of the test server. The application stops to work, whenever I ask for a page the server returns a blank page and nothing is showed on the browser. After investigating log files I checked that asp.net still search state database with the name of the database in temp server. The problem originates from the fact that all the stored procedures that are in session state server use three part name. Golden rule is that asp.net session store database and authentication database should be created using aspnet_regsql.exe and not with a synchronization procedure from an existing database.

Alk.

The advantage of Word2007 blogging

Some of my friends told me that word 2007 is not the right tool to blog, I really must admit that some aspects are not so good, such as code formatting. But one of my favorite option is the ability to include office 2007 graph and images. Really amazing.

Just one click and I can really change the aspect of everything in the graph, for technical blogs this is really a good thing.

And I’m only changing the predefined styles of graphs, I’m actually just copy and paste and click a couple of buttons

Really amazing.

Alk.