I dont think NH actually opens a connection, but your correct that it does want a connection string.
What Ive done in a similar situation is to create a class which inherits from DriverConnectionProvider and override ConnectionString so I can change the connection string 'at will'. Like you, I dont know the actual DB that will be used when creating the SessionFactory so I just provide a dummy connection string to start with, then later provide the actual connection string later (via the inherited DriverConnectionProvider). Also, you can wire up NH to use your custom DriverConnectionProvider by setting your "provider" type (in FNH: Fluently.Configure().Database(MsSqlConfiguration.MsSql2005.Provider<DynamicDriverConnectionProvider>() ) On Sep 21, 4:00 am, Niclas Pehrsson <[email protected]> wrote: > Hi I need to prevent NHibernate to call the database on > configuration.BuildSessionFactory() > Cause I don't know the connectionstring when building the > SessionFactory. > > I have locted where it calls the database when building and it is in > the SessionFactory's constructor. > > if (settings.IsKeywordsImportEnabled) > { > SchemaMetadataUpdater.Update(this); > } > if (settings.IsAutoQuoteEnabled) > { > > SchemaMetadataUpdater.QuoteTableAndColumns(cfg); > } > > What is the drawbacks to disable IsKeywordsImportEnabled and > IsAutoQuoteEnabled ? -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
