Esempio n. 1
0
        /// <summary>
        /// Run checkpoint command to copy log file into data file
        /// </summary>
        public Task <int> CheckpointAsync()
        {
            if (_disposed == true)
            {
                throw LiteException.DatabaseClosed();
            }

            return(_walIndex.Checkpoint());
        }
Esempio n. 2
0
        /// <summary>
        /// Get current transaction or create a new one
        /// </summary>
        internal async Task <TransactionService> GetTransaction()
        {
            if (_disposed)
            {
                throw LiteException.DatabaseClosed();
            }

            if (_transaction == null)
            {
                // lock transaction
                await _locker.WaitAsync(_header.Pragmas.Timeout);

                _transaction = new TransactionService(_header, _disk, _walIndex);
            }

            return(_transaction);
        }