I am creating a multi-threaded system that works as follows:
While there are objects:
When I start this new thread, it should have a new session, because nHibernate is not thread safe. I create it, but the object received earlier does not work for this session.
Today I allow this situation to fetch a new Entity passing id from nHibernate. But it’s expensive, and I’m trying to save time to reach my SLA.
Is there a way to associate this object with this new session without having to make a new database call? Another session will not be closed, they will all be open until the end of the application.
source
share