Jugal Panchal
Jugal Panchal

Reputation: 1548

Count Session in Nhibernate

I am using Fluent NHibernate. I want to count number of session gets created and present in application. Is there any way to count that ?

Please share your view and suggestion.

Upvotes: 1

Views: 1051

Answers (1)

h.alex
h.alex

Reputation: 902

When creating your configuration, do also:

var config = new Configuration();

config.DataBaseIntegration(db => { .. });
config.SessionFactory().GenerateStatistics();

And then look at:

SessionFactory.Statistics.EntityFetchCount

Upvotes: 2

Related Questions