Question

Have an application that benefits greatly from FluentNHibernate/NHibernate.

Still learning FNH and NH.

A portion of the application writes summary data at the end of each event. Which over 100,000 can occur per day.

My question is, is there best practices for mapping tables of this volume of data?

I don't really want to maintain them in session if I don't need to.

Was it helpful?

Solution

there is a IStatelessSession which is meant for bulk inserts. It does not maintain a session cache.

Usage:

using (var session = _sessionfactory.OpenStatelessSession())
{
    for (int i = 0; i < 100000; i++)
    {
        session.Insert(new Something());
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top