This connection provider keeps a list of all open connections, it is used when testing to check that tests clean up after themselves.
Inheritance: NHibernate.Connection.DriverConnectionProvider
Esempio n. 1
0
 private void Cleanup()
 {
     sessions.Close();
     sessions           = null;
     connectionProvider = null;
     lastOpenedSession  = null;
     cfg = null;
 }
Esempio n. 2
0
        protected virtual void BuildSessionFactory()
        {
            sessions = cfg.BuildSessionFactory();
            ISessionFactoryImplementor sessionsImpl = sessions as ISessionFactoryImplementor;

            connectionProvider = sessionsImpl == null
                                         ? null
                                         : sessionsImpl.ConnectionProvider as DebugConnectionProvider;
        }
Esempio n. 3
0
 private void Cleanup()
 {
     if (sessions != null)
     {
         sessions.Close();
     }
     sessions           = null;
     connectionProvider = null;
     _lastOpenedSession = null;
     _openedSessions    = new ConcurrentBag <ISession>();
     cfg = null;
 }
		/// <summary>
		/// Drops the schema that was built with the TestCase's Configuration.
		/// </summary>
		private void DropSchema()
		{
			sessions.Close();
			sessions = null;
			dialect = null;
			connectionProvider = null;
			lastOpenedSession = null;

			new SchemaExport( cfg ).Drop( OutputDdl, true );
			cfg = null;
		}
		private void ExportSchema( IList files, string assemblyName )
		{
			cfg = new Configuration();

			for( int i = 0; i < files.Count; i++ )
			{
				cfg.AddResource( assemblyName + "." + files[ i ].ToString(), Assembly.Load( assemblyName ) );
			}

			new SchemaExport( cfg ).Create( OutputDdl, true );

			sessions = cfg.BuildSessionFactory();
			dialect = Dialect.Dialect.GetDialect();
			connectionProvider = sessions.ConnectionProvider as DebugConnectionProvider;
		}
Esempio n. 6
0
 private void Cleanup()
 {
     sessions.Close();
     sessions = null;
     connectionProvider = null;
     lastOpenedSession = null;
     cfg = null;
 }
Esempio n. 7
0
 protected virtual void BuildSessionFactory()
 {
     sessions = cfg.BuildSessionFactory();
     ISessionFactoryImplementor sessionsImpl = sessions as ISessionFactoryImplementor;
     connectionProvider = sessionsImpl == null
                                  ? null
                                  : sessionsImpl.ConnectionProvider as DebugConnectionProvider;
 }
Esempio n. 8
0
 protected virtual void BuildSessionFactory()
 {
     sessions           = (ISessionFactoryImplementor)cfg.BuildSessionFactory();
     connectionProvider = sessions.ConnectionProvider as DebugConnectionProvider;
 }
Esempio n. 9
0
		protected virtual void BuildSessionFactory()
		{
			sessions = (ISessionFactoryImplementor)cfg.BuildSessionFactory();
			connectionProvider = sessions.ConnectionProvider as DebugConnectionProvider;
		}
 private void Cleanup()
 {
     if (this.sessions != null)
     {
         this.sessions.Close();
     }
     this.sessions = null;
     this.connectionProvider = null;
     this.lastOpenedSession = null;
     this.cfg = null;
 }
 /// <summary>
 /// Builds the session factory.
 /// </summary>
 protected virtual void BuildSessionFactory()
 {
     this.sessions = (ISessionFactoryImplementor)this.cfg.BuildSessionFactory();
     this.connectionProvider = this.sessions.ConnectionProvider as DebugConnectionProvider;
 }