c# - NHibernate Statistics Queries not visible -


I am trying to use nHibernate IStatistics for my app. I have such a code < Pre> IStatistics stats = GetSessionFactory (). Statistics; Var queryCount = stats.QueryExecutionCount; Var queries = stats.Queries;

The query is populated with the value for the query query number, but the query string array is always empty. Is there a reason for this? I am using NHibernate 3.0.

Do this before running any query:

  statistics . Istatatics enabled = enabled;   

After doing this, the following code:

  session.CreateQuery ("From Foo"). List (); Console.WriteLine (stats.Queries [0]);   

... will be printed with "foo".

Only HQL queries are stored (LINQ also, but only string is not very useful)

Comments