Ive implemented something similar and just provide a default connection string, not even a valid one, because NH expects to have one when starting up but doesn't actually 'use' it right off; Then, I inject an actual connection string when creating the Session.
On Sep 10, 12:38 pm, Eric <[email protected]> wrote: > I am already doing that... upon creating the > MultiSessionFactoryProvider, it is calling > DriverConnectionProvider.GetConnection() > If I leave the connection string null or invalid, an exception is > thrown. > > Is there a way to prevent nhibernate from connecting right away? > > On Sep 10, 1:24 pm, José F. Romaniello <[email protected]> wrote: > > > 2010/9/10 Eric <[email protected]> > > > > Once I get it working, I will... how would I submit it? Is there a > > > page with notes on contribution? > > > Contact me directly. > > > > One more problem I'm having... > > > Upon start-up and prior to wanting to connect to a particular > > > database, the "GetConnection()" of my DriverConnectionProvider > > > derivative is being called... > > > At this point, I don't know the actual connection string or database > > > I'm connecting to, so I want to create the factory but not a real > > > connection. > > > > 1. Is there a way to tell nhibernate to not try to connect right away? > > > 2. If not, could I easily create a new driver that doesn't really do > > > anything and use it as the default factory and "connection"? (does > > > something like this already exist?) > > > The easy way is to create a connectionprovider, and override the > > connectionstrnigproperty... You could feed this class in other places. > > > > Thanks, > > > Eric > > > > On Sep 9, 8:31 pm, José F. Romaniello <[email protected]> wrote: > > > > I like it! > > > > > If you want to contribute with a little-little example of this to the > > > > unhaddins project, doors are open :) > > > > > 2010/9/9 Eric <[email protected]> > > > > > > I think I know what I need to do... let me know what you think. > > > > > > I should create a class that derives from MultiSessionFactoryProvider > > > > > and handle my 'active factory' variable. > > > > > I should also create a new interface IMyAppConnectionController and > > > > > class which also has a reference to the SessionFactoryProvider and > > > > > controls the 'active factory' variable and connection string. > > > > > > Thanks, > > > > > Eric > > > > > > -- > > > > > 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]<nhusers%[email protected]> > > > <nhusers%[email protected]<nhusers%[email protected]> > > > > > > . > > > > > For more options, visit this group at > > > > >http://groups.google.com/group/nhusers?hl=en. > > > > -- > > > 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]<nhusers%[email protected]> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/nhusers?hl=en. -- 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.
