UnitOfWorkFactoryBase implements IUnitOfWorkFactory and owns the connection-string-keyed ISessionFactory caching, per-process locking, and ISessionHelper construction shared across engines; OracleUnitOfWorkFactory, OracleStatelessUnitOfWorkFactory, and SqlServerUnitOfWorkFactory supply only the engine/session-strategy-specific session-opening logic (CreateUnitOfWork).
Caches ISessionFactory instances in a static dictionary keyed by connection string, guarded by a lock, so repeated GetUnitOfWork calls for the same connection string reuse the same factory.
Resolves the PersistenceConfiguration for a connection string (via the injected IConfigurationFactory) and calls Configuration.BuildSessionFactory() when no cached factory exists.
Builds the engine-specific ISessionHelper (OracleSessionHelper/SqlServerSessionHelper) to pair with the opened session.
NHibernateUnitOfWork GetUnitOfWork(string connectionString, int batchSize, bool showSql)
Locks the static SessionFactories dictionary, gets-or-adds an ISessionFactory via BuildSessionFactory, calls the subclass's CreateUnitOfWork(factory) override, builds the matching ISessionHelper, and returns a new NHibernateUnitOfWork.
Engine/session-strategy-specific: opens a stateful ISession (CreateSessionUnitOfWork) or stateless IStatelessSession (CreateStatelessSessionUnitOfWork) and wraps it in the matching ISessionStrategy implementation.
The SessionFactories dictionary and its lock are static and shared per-process across all connection strings passed to any instance of this class or its subclasses.
A new NHibernateUnitOfWork (and a new underlying session) is returned on every call — only the ISessionFactory is cached, not the session itself.