Deveel.Data.Database.Close C# (CSharp) Method

Close() private method

Closes the database making it not accessible to connections.
Typical implementations of this interface will automatically invoke the closure of the database on disposal (IDisposable.Dispose.
/// The database is not initialized. /// or /// An error occurred during database shutdown. ///
private Close ( ) : void
return void
        internal void Close()
        {
            if (!IsOpen)
                throw new DatabaseSystemException("The database is not initialized.");

            try {
                if (Context.DeleteOnClose()) {
                    // Delete the tables if the database is set to delete on
                    // shutdown.
                    TableComposite.Delete();
                } else {
                    // Otherwise close the conglomerate.
                    TableComposite.Close();
                }
            } catch (DatabaseSystemException) {
                throw;
            } catch (Exception e) {
                throw new DatabaseSystemException("An error occurred during database shutdown.", e);
            } finally {
                IsOpen = false;
            }
        }