nhprof

NHibernate, ActiveRecord, Transaction database locks and when Commits are flushed

This is a common question, but the explanations found so far and observed behaviour are some way apart. We have want the following nHbernate strategy in our MVC website: A SessionScope for the request (to track changes) A ActiveRecord.TransacitonScope to wrap our inserts only (to enable rollback/commit of batch) Selects to be outside ...

Nhibernate profiler Question

Hi I'm trying to get session open statistics for nhibernate wtih Nhibernate profiler. We got an issue where a session gets left open on error in transaction mode and gets reused, blowing up when temptables are created. I've got generate statistics on in the config. But I can't see any "Currently open sessions" count and the "Session O...

NHibernate Linq uses implicit transaction?

I'm using Ayende's NHibernate Linq version 2.1.2, available here, and when I use NHProf to inspect queries that use this method: public IQueryable<T> GetAll() { return Session.Linq<T>(); } It gives me the warning that I'm using an implicit transaction. Problem is, I'm using this in a repository to abstract out the database session...

Setting up HProf for Hibernate

How do I setup NhProf for Hibernate? ...

NHibernate taking a long time to run query

This is being done using Fluent NHibernate I've got a NHibernate lookup that is retrieving data from one table. If i take the generated sql and run it through query analyzer, it takes ~18ms to run. Using NHProfiler, i'm getting the duration of this query as ~1800ms - 100 times longer than sql ! Query duration - Database only:1800ms...

How do I configure NHibernate Profiler so I can enable/disable it without changing code?

I've been trying to follow the directions on the NHProf site but can't seem to make it work. What am I missing? I put a log4net configuration section in my web.config: <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net/> ... </configSections> ... <log4net> <appender name="NH...

Load vs Get in Nhibernate

The master page in my web application does authentication and loads up the user entity using a Get. After this whenever the user object is needed by the usercontrols or any other class I do a Load. Normally nhibernate is supposed to load the object from cache or return the persistent loaded object whenever Load of called. But this i...

"Using a single session in multiple threads is likely a bug" error in NHProf when using NServiceBus

When executing an NServiceBus handler that uses NHibernate for its data access operations, I am seeing an error that I am not sure if I need to be concerned with. The handler has code that does something like this: using (var tx = Session.BeginTransaction()) { var accountGroup = _groupRepository.FindByID(message.GroupID); acc...

Count number of queries executed by NHibernate in a unit test

In some unit/integration tests of the code we wish to check that correct usage of the second level cache is being employed by our code. Based on the code presented by Ayende here: http://ayende.com/Blog/archive/2006/09/07/MeasuringNHibernatesQueriesPerPage.aspx I wrote a simple class for doing just that: public class QueryCounter : I...

How to get NHProf reports in TeamCity running MSBUILD

I'm trying to get NHProf reports on my integration tests as a report in TeamCity I'm not sure how to get this set up correctly and my first attempts are unsuccessful. Let me know if there is any more information that would be helpful... I'm getting the following error, when trying to generate html reports with MSBUILD (which is being ...

fail-safe cleanup (collections) warning after committing transaction with NHibernate

When looking in NHProfiler I get following warning after committing my transaction: fail-safe cleanup (collections) : NHibernate.Engine.Loading.CollectionLoadContext I have absolutely no idea what this could be or how I can solve this. Can somebody help me? Thanks, Jelle ...

Clearing NHibernate Cache Inbetween Profiling Runs with NHProf

We are attepting to profile our NHibernate application using NHProf. We have a series of unit tests which exercise various calls. However, if we run the unit test multiple times, we get differing results in NHProf: Session 1 [1] Session 2 [32] Session 3 [32] Session 4 [2] Session 5 [2] I've tried calling session.Clear() at the end of...