ConfigurationFactoryBase implements IConfigurationFactory and owns the connection-string-keyed caching and configuration-file deserialization logic shared by both database engines; OracleConfigurationFactory and SqlServerConfigurationFactory supply only the engine-specific pieces (driver/dialect configuration and the serialized-config file name).
Caches built PersistenceConfiguration instances in a static ConcurrentDictionary<string, PersistenceConfiguration> keyed by connection string, so GetConfiguration is a cache hit on repeat calls for the same connection string.
Attempts to deserialize a previously-serialized NHibernate Configuration from a binary file (via BinaryFormatter) before building a fresh one, silently swallowing any deserialization exception and falling back to a fresh build — a behavior documented in Architecture as a design constraint rather than a business rule.
Delegates engine-specific bootstrap (Fluently.Configure() with the correct driver/dialect, assembly scanning for ClassMap<T>/.hbm.xml mappings) to the abstract GetNewConfiguration/GetConfigurationFileName members implemented by subclasses.
protected PersistenceConfiguration CreateConfiguration(string connection, int batchSize, bool showSql)
Attempts deserialization of a previously-serialized Configuration; on failure or absence, calls the engine-specific GetNewConfiguration, then sets Environment.ConnectionString/BatchSize/ShowSql.
Deserializes a Configuration from {assemblyDirectory}\{GetConfigurationFileName()} using BinaryFormatter; returns null on any exception (including file-not-found).
Engine-specific: configures Fluently.Configure() with the correct driver/dialect and scans for ClassMap<T>/.hbm.xml mappings. Implemented by OracleConfigurationFactory/SqlServerConfigurationFactory.
Engine-specific: returns the serialized-config file name (Oracle.config or SqlServer.config). Implemented by OracleConfigurationFactory/SqlServerConfigurationFactory.
Deserialization failures are silently swallowed (caught Exception, configuration set to null, forcing a fresh build) — this affects startup latency after a corrupted or stale .config cache file but not correctness, since a fresh configuration is always built as a fallback.
Subclasses must implement GetNewConfiguration and GetConfigurationFileName; ConfigurationFactoryBase itself cannot be instantiated directly.
The cache (Configurations dictionary) is static and shared per-process across all connection strings passed to any instance of this class or its subclasses.