You can create your own HibernateTransactionManager , which creates both types of sessions. This is a bit of an overhead since sessions are cheap to create.
Start by copying this class from the Spring.NET source tree. Open and close IStatelessSession when this is done for a regular ISession. Put your IStatelessSession in Spring.Threading.HybridContextStorage for easy access.
Next, create a GetStatelessSession extension method or method for your classes that require IStatelessSession.
Alternatively, and if you are using SQL Server, it is best to use SqlBulkCopy .
source share