Exemplo n.º 1
0
 /// <summary>
 /// Frees the connections established during Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.AcquireConnections(System.Object).
 ///     Called at design time and run time.
 /// </summary>
 public override void ReleaseConnections()
 {
     if (m_ConnMgr != null)
     {
         m_ConnMgr.ReleaseConnection(database);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Frees the connections established during Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.AcquireConnections(System.Object).
 ///     Called at design time and run time.
 /// </summary>
 public override void ReleaseConnections()
 {
     if (_connMgr != null)
     {
         _connMgr.ReleaseConnection(_db);
     }
 }
Exemplo n.º 3
0
        public void TestReleaseConnectionsDelegatesToConnectionManager()
        {
            PrivateObject p = new PrivateObject(typeof(MongoDataSource.MongoDataSource));

            IDTSConnectionManager100 connManager = Mock.Create <IDTSConnectionManager100>(Constructor.Mocked);

            p.SetField("m_ConnMgr", connManager);

            MongoDatabase mockedDb = Mock.Create <MongoDatabase>(Constructor.Mocked);

            p.SetField("database", mockedDb);

            p.Invoke("ReleaseConnections", null);

            Mock.Assert(() => connManager.ReleaseConnection(mockedDb));
        }
        //=================================================================================================

        public override void ReleaseConnections()
        {
            if (m_scope == null)
            {
                return;
            }

            // get the runtime connection
            IDTSRuntimeConnection100 conn =
                ComponentMetaData.RuntimeConnectionCollection[CONNECTION_NAME];

            IDTSConnectionManager100 connMgr = conn.ConnectionManager;

            connMgr.ReleaseConnection(m_scope);

            m_scope = null;
        }
Exemplo n.º 5
0
 public override void ReleaseConnections()
 {
     connMgr.ReleaseConnection(sqlConn);
 }