internal void Open()
{
if (IsOpen)
throw new DatabaseSystemException("The database was already initialized.");
try {
// Check if the state file exists. If it doesn't, we need to report
// incorrect version.
if (!TableComposite.Exists())
// If neither store or state file exist, assume database doesn't
// exist.
throw new DatabaseSystemException(String.Format("The database {0} does not exist.", Name));
// Open the conglomerate
TableComposite.Open();
AssertDataVersion();
} catch (DatabaseSystemException) {
throw;
} catch (Exception e) {
throw new DatabaseSystemException("An error occurred when initializing the database.", e);
}
IsOpen = true;
}