NHibernate + SLX
Nicolas Galler | November 12, 2006The last project was porting the SLX leads management module to the web. Obviously I did not want to have to deal with the SLXWEB development environment so I have developed it as an ASP.NET website. I am using NHibernate 1.0.2 for object persistence. Of course there were a few rough patches but overall it went in pretty well, doesn’t seem to have any problem chatting with the SLX OLEDB provider and generating SLX ids. I have yet to decide, however, if it is actually worth the hassle vs creating my own DAO from scratch! The hope I have is that some of the performance features (caching, lazy loading) will pay off. A lot of the “plumbing” is implemented in a shared assembly so we will also be able to reuse it for future projects (including a MyGeneration template that generates the code automatically, though I need to change this one to take advantage of the JOINDATA table instead of using the SQL constraints since SLX “forgot” to implement those).
I just found out about the ISession.FlushMode property. Set that to commit and it seemed to yield a big performance improvement (though actually it seems a bit too big to be true and I think what happened is my laptop was bogged down when I ran a performance test last week… it went from 2 minutes to 10 seconds). Anyway this is a good thing considering I will only call Save from my DAO objects, to ensure everything is consistently wrapped in transactions.





