BlockNotificationThread() 개인적인 메소드

private BlockNotificationThread ( ) : NotificationThreadBlock
리턴 NotificationThreadBlock
예제 #1
0
        /// <summary>
        /// Called after writing all data to CopyStream to successfully complete this copy operation.
        /// </summary>
        public void End()
        {
            if (_context != null)
            {
                try
                {
                    if (IsActive)
                    {
                        // Stop Notification thread so we can process this message.
                        // See bug 1010796

                        using (_context.BlockNotificationThread())

                        {
                            _context.CurrentState.SendCopyDone(_context);
                        }
                    }
                }
                finally
                {
                    if (_context.Mediator.CopyStream == _copyStream)
                    {
                        _context.Mediator.CopyStream = null;
                    }
                    if (_disposeCopyStream)
                    {
                        _copyStream = null;
                    }
                }
            }
        }
예제 #2
0
        internal static void ExecuteBlindSuppressTimeout(NpgsqlConnector connector, NpgsqlQuery query)
        {
            // Block the notification thread before writing anything to the wire.
            using (var blocker = connector.BlockNotificationThread())
            {
                // Write the Query message to the wire.
                connector.Query(query);

                // Flush, and wait for and discard all responses.
                connector.ProcessAndDiscardBackendResponses();
            }
        }
        internal static void ExecuteBlindSuppressTimeout(NpgsqlConnector connector, NpgsqlQuery query)
        {
            // Block the notification thread before writing anything to the wire.
            using (var blocker = connector.BlockNotificationThread())
            {
                // Write the Query message to the wire.
                connector.Query(query);

                // Flush, and wait for and discard all responses.
                connector.ProcessAndDiscardBackendResponses();
            }
        }
        private static void ExecuteBlind(NpgsqlConnector connector, NpgsqlQuery query, int timeout)
        {
            // Block the notification thread before writing anything to the wire.
            using (var blocker = connector.BlockNotificationThread())
            {
                // Set statement timeout as needed.
                connector.SetBackendCommandTimeout(timeout);

                // Write the Query message to the wire.
                connector.Query(query);

                // Flush, and wait for and discard all responses.
                connector.ProcessAndDiscardBackendResponses();
            }
        }
        private static void ExecuteBlind(NpgsqlConnector connector, NpgsqlQuery query, int timeout)
        {
            // Block the notification thread before writing anything to the wire.
            using (var blocker = connector.BlockNotificationThread())
            {
                // Set statement timeout as needed.
                connector.SetBackendCommandTimeout(timeout);

                // Write the Query message to the wire.
                connector.Query(query);

                // Flush, and wait for and discard all responses.
                connector.ProcessAndDiscardBackendResponses();
            }
        }