Harlinn.Windows 0.1
|
An instance of the database engine for use in a single process. More...
#include <HCCEse.h>
Public Member Functions | |
Instance () noexcept | |
template<SimpleWideStringLike StringT1, SimpleWideStringLike StringT2 = WideString> | |
Instance (const StringT1 &instanceName, const StringT2 &displayName=StringT2(), InitFlags initFlags=InitFlags::None) | |
template<SimpleAnsiStringLike StringT1, SimpleAnsiStringLike StringT2 = AnsiString> | |
Instance (const StringT1 &instanceName, const StringT2 &displayName=StringT2(), InitFlags initFlags=InitFlags::None) | |
Instance (const wchar_t *instanceName, const wchar_t *displayName=nullptr, InitFlags initFlags=InitFlags::None) | |
Instance (const char *instanceName, const char *displayName=nullptr, InitFlags initFlags=InitFlags::None) | |
Instance (const InstanceOptions &instanceOptions) | |
Instance (const Instance &other)=delete | |
Instance (Instance &&other) noexcept | |
Instance & | operator= (const Instance &other)=delete |
Instance & | operator= (Instance &&other) noexcept |
~Instance () | |
JET_INSTANCE | Handle () const |
constexpr bool | IsValid () const noexcept |
constexpr | operator bool () const noexcept |
Session | BeginSession () const |
Starts a session and initializes and returns a new Session object for the handle. | |
Result | Backup (const wchar_t *backupPath, BackupFlags backupFlags, JET_PFNSTATUS statusCallbackFunction=nullptr) const |
Result | Backup (const char *backupPath, BackupFlags backupFlags, JET_PFNSTATUS statusCallbackFunction=nullptr) const |
template<SimpleStringLike StringT> | |
Result | Backup (const StringT &backupPath, BackupFlags backupFlags, JET_PFNSTATUS statusCallbackFunction=nullptr) const |
Result | Restore (const wchar_t *backupPath, const wchar_t *destinationPath, JET_PFNSTATUS statusCallbackFunction=nullptr) const |
Result | Restore (const char *backupPath, const char *destinationPath, JET_PFNSTATUS statusCallbackFunction=nullptr) const |
template<SimpleStringLike StringT1, SimpleStringLike StringT2> requires std::is_same_v<typename StringT1::value_type, typename StringT2::value_type> | |
Result | Restore (const StringT1 &backupPath, const StringT2 &destinationPath, JET_PFNSTATUS statusCallbackFunction=nullptr) const |
Result | Restore (const wchar_t *backupPath, JET_PFNSTATUS statusCallbackFunction=nullptr) const |
Result | Restore (const char *backupPath, JET_PFNSTATUS statusCallbackFunction=nullptr) const |
template<SimpleStringLike StringT> | |
Result | Restore (const StringT &backupPath, JET_PFNSTATUS statusCallbackFunction=nullptr) const |
template<StringLike StringT> | |
StringT | QueryAlternateDatabaseRecoveryPath () const |
template<StringLike StringT> | |
void | SetAlternateDatabaseRecoveryPath (const StringT &value) const |
bool | QueryCleanupMismatchedLogFiles () const |
void | SetCleanupMismatchedLogFiles (bool value) const |
bool | QueryDeleteOutOfRangeLogs () const |
void | SetDeleteOutOfRangeLogs (bool value) const |
TimeSpan | QuerySnapshotTimeout () const |
void | SetSnapshotTimeout (const TimeSpan &value) const |
bool | QueryZeroDatabaseDuringBackup () const |
void | SetZeroDatabaseDuringBackup (bool value) const |
long | QueryDbExtensionSize () const |
void | SetDbExtensionSize (long value) const |
bool | QueryEnableIndexCleanup () const |
void | SetEnableIndexCleanup (bool value) const |
OnlineDefragFlags | QueryEnableOnlineDefrag () const |
void | SetEnableOnlineDefrag (OnlineDefragFlags value) const |
long | QueryPageFragment () const |
void | SetPageFragment (long value) const |
long | QueryRecordUpgradeDirtyLevel () const |
void | SetRecordUpgradeDirtyLevel (long value) const |
long | QueryWaypointLatency () const |
void | SetWaypointLatency (long value) const |
bool | QueryDefragmentSequentialBTrees () const |
void | SetDefragmentSequentialBTrees (bool value) const |
long | QueryDefragmentSequentialBTreesDensityCheckFrequency () const |
void | SetDefragmentSequentialBTreesDensityCheckFrequency (long value) const |
TimeSpan | QueryIOThrottlingTimeQuanta () const |
void | SetIOThrottlingTimeQuanta (const TimeSpan &value) const |
TimeSpan | QueryAccessDeniedRetryPeriod () const |
void | SetAccessDeniedRetryPeriod (const TimeSpan &value) const |
bool | QueryCreatePathIfNotExist () const |
When this parameter is set to true then any folder that is missing in a file system path in use by the database engine will be silently created. Otherwise, the operation that uses the missing file system path will throw an Ese::Exception for Result::ErrorInvalidPath. | |
void | SetCreatePathIfNotExist (bool value=true) const |
When this parameter is set to true then any folder that is missing in a file system path in use by the database engine will be silently created. Otherwise, the operation that uses the missing file system path will throw an Ese::Exception for Result::ErrorInvalidPath. | |
bool | QueryIOPriorityLow () const |
void | SetIOPriorityLow (bool value) const |
unsigned long long | QueryMaxCoalesceReadSize () const |
void | SetMaxCoalesceReadSize (unsigned long long value) const |
unsigned long long | QueryMaxCoalesceWriteSize () const |
void | SetMaxCoalesceWriteSize (unsigned long long value) const |
unsigned long long | QueryMaxCoalesceReadGapSize () const |
void | SetMaxCoalesceReadGapSize (unsigned long long value) const |
unsigned long long | QueryMaxCoalesceWriteGapSize () const |
void | SetMaxCoalesceWriteGapSize (unsigned long long value) const |
bool | QueryDisableCallbacks () const |
void | SetDisableCallbacks (bool value) const |
bool | QueryEnablePersistedCallbacks () const |
void | SetEnablePersistedCallbacks (bool value) const |
JET_CALLBACK * | QueryRuntimeCallback () const |
void | SetRuntimeCallback (JET_CALLBACK *value) const |
unsigned long long | QueryCacheSize () const |
void | SetCacheSize (unsigned long long value) const |
unsigned long long | QueryCacheSizeMin () const |
void | SetCacheSizeMin (unsigned long long value) const |
unsigned long long | QueryCacheSizeMax () const |
void | SetCacheSizeMax (unsigned long long value) const |
unsigned long long | QueryCheckpointDepthMax () const |
void | SetCheckpointDepthMax (unsigned long long value) const |
unsigned long long | QueryCheckpointIOMax () const |
void | SetCheckpointIOMax (unsigned long long value) const |
unsigned long long | QueryStartFlushThreshold () const |
void | SetStartFlushThreshold (unsigned long long value) const |
unsigned long long | QueryStopFlushThreshold () const |
void | SetStopFlushThreshold (unsigned long long value) const |
template<StringLike StringT> | |
StringT | QueryBaseName () const |
This parameter sets the three letter prefix used for many of the files used by the database engine. For example, the checkpoint file is called EDB.CHK by default because EDB is the default base name. The base name can be used to easily distinguish between sets of files that belong to different instances or to different applications. | |
template<SimpleStringLike StringT> | |
void | SetBaseName (const StringT &value) const |
bool | QueryCircularLog () const |
This parameter configures how transaction log files are managed by the database engine. | |
void | SetCircularLog (bool value=true) const |
This parameter configures how transaction log files are managed by the database engine. | |
TransactionFlags | QueryCommitDefault () const |
void | SetCommitDefault (TransactionFlags value) const |
bool | QueryDeleteOldLogs () const |
void | SetDeleteOldLogs (bool value) const |
bool | QueryIgnoreLogVersion () const |
void | SetIgnoreLogVersion (bool value) const |
bool | QueryLegacyFileNames () const |
void | SetLegacyFileNames (bool value) const |
unsigned long long | QueryLogBuffers () const |
void | SetLogBuffers (unsigned long long value) const |
unsigned long long | QueryLogCheckpointPeriod () const |
void | SetLogCheckpointPeriod (unsigned long long value) const |
bool | QueryLogFileCreateAsynch () const |
void | SetLogFileCreateAsynch (bool value) const |
template<StringLike StringT> | |
StringT | QueryLogFilePath () const |
This parameter indicates the relative or absolute file system path of the folder that will contain the transaction logs for the instance. | |
template<SimpleStringLike StringT> | |
void | SetLogFilePath (const StringT &value) const |
This parameter indicates the relative or absolute file system path of the folder that will contain the transaction logs for the instance. | |
unsigned long long | QueryLogFileSize () const |
void | SetLogFileSize (unsigned long long value) const |
unsigned long long | QueryLogWaitingUserMax () const |
void | SetLogWaitingUserMax (unsigned long long value) const |
template<StringLike StringT> | |
StringT | QueryRecovery () const |
template<SimpleStringLike StringT> | |
void | SetRecovery (const StringT &value) const |
template<StringLike StringT> | |
StringT | QuerySystemPath () const |
This parameter indicates the relative or absolute file system path of the folder that will contain the checkpoint file for the instance. The path must be terminated with a backslash character, which indicates that the target path is a folder. The checkpoint file is a simple file maintained per instance that remembers the oldest transaction log file that must be replayed to bring all databases in that instance to a consistent state after a crash. The checkpoint file is typically named EDB.CHK. | |
template<SimpleStringLike StringT> | |
void | SetSystemPath (const StringT &value) const |
This parameter indicates the relative or absolute file system path of the folder that will contain the checkpoint file for the instance. The path must be terminated with a backslash character, which indicates that the target path is a folder. The checkpoint file is a simple file maintained per instance that remembers the oldest transaction log file that must be replayed to bring all databases in that instance to a consistent state after a crash. The checkpoint file is typically named EDB.CHK. | |
unsigned long long | QueryNumberOfCachedClosedTables () const |
This setting controls the number of B+ Tree resources cached by the instance after the tables they represent have been closed by the application. | |
void | SetNumberOfCachedClosedTables (size_t value) const |
This setting controls the number of B+ Tree resources cached by the instance after the tables they represent have been closed by the application. | |
unsigned long long | QueryMaxCursorCount () const |
void | SetMaxCursorCount (size_t value) const |
unsigned long long | QueryMaxOpenTableCount () const |
void | SetMaxOpenTableCount (size_t value) const |
unsigned long long | QueryPreferredMaxOpenTables () const |
void | SetPreferredMaxOpenTables (size_t value) const |
unsigned long long | QueryMaxSessionCount () const |
void | SetMaxSessionCount (size_t value) const |
unsigned long long | QueryMaxTemporaryTableCount () const |
void | SetMaxTemporaryTableCount (size_t value) const |
unsigned long long | QueryMaxVersionPageCount () const |
void | SetMaxVersionPageCount (size_t value) const |
unsigned long long | QueryPageHintCacheSize () const |
void | SetPageHintCacheSize (size_t value) const |
Static Public Member Functions | |
static long | QueryDatabasePageSize () |
static void | SetDatabasePageSize (long value) |
static bool | QueryEnableIndexChecking () |
static void | SetEnableIndexChecking (bool value) |
static bool | QueryOneDatabasePerSession () |
static void | SetOneDatabasePerSession (bool value) |
static bool | QueryEnableFileCache () |
static void | SetEnableFileCache (bool value) |
static unsigned | QueryOutstandingIOMax () |
static void | SetOutstandingIOMax (unsigned value) |
static Int32 | QueryBatchIOBufferMax () |
static void | SetBatchIOBufferMax (Int32 value) |
static bool | QueryEnableViewCache () |
static void | SetEnableViewCache (bool value) |
static TimeSpan | QueryLRUKCorrInterval () |
static void | SetLRUKCorrInterval (TimeSpan value) |
static unsigned long long | QueryLRUKHistoryMax () |
static void | SetLRUKHistoryMax (unsigned long long value) |
static unsigned long long | QueryLRUKPolicy () |
static void | SetLRUKPolicy (unsigned long long value) |
static TimeSpan | QueryLRUKTimeout () |
static void | SetLRUKTimeout (const TimeSpan &value) |
static ExceptionAction | QueryExceptionAction () |
This setting controls what happens when an exception is thrown by the database engine or code that is called by the database engine. When set to ExceptionAction::DisplayMessageBox, any exception will be thrown to the Windows unhandled exception filter.This will result in the exception being handled as an application failure.The intent is to prevent application code from erroneously trying to catch and ignore an exception generated by the database engine.This cannot be allowed because database corruption could occur.If the application wishes to properly handle these exceptions then the protection can be disabled by setting this parameter to ExceptionAction::None. | |
static void | SetExceptionAction (Ese::ExceptionAction value) |
This setting controls what happens when an exception is thrown by the database engine or code that is called by the database engine. When set to ExceptionAction::DisplayMessageBox, any exception will be thrown to the Windows unhandled exception filter.This will result in the exception being handled as an application failure.The intent is to prevent application code from erroneously trying to catch and ignore an exception generated by the database engine.This cannot be allowed because database corruption could occur.If the application wishes to properly handle these exceptions then the protection can be disabled by setting this parameter to ExceptionAction::None. | |
static unsigned long long | QueryEventLogCacheSize () |
static void | SetEventLogCacheSize (size_t numberOfBytes) |
static bool | QueryMonitoringPerformance () |
static void | SetMonitoringPerformance (bool value) |
static unsigned long long | QueryGlobalMinimumVersionPageCount () |
static void | SetGlobalMinimumVersionPageCount (size_t value) |
static unsigned long long | QueryMaximumInstanceCount () |
static void | SetMaximumInstanceCount (size_t value) |
Public Attributes | |
boost::signals2::signal< void(const Instance *instance)> | BeforeInit |
boost::signals2::signal< void(const Instance *instance)> | AfterInit |
Private Member Functions | |
void | InitializeInstance () const |
unsigned long long | GetSystemNumericParameter (unsigned long paramId) const |
void | GetSystemStringParameter (unsigned long paramId, JET_PWSTR szParam, unsigned long cbMax) const |
template<WideStringLike StringT> | |
StringT | GetSystemStringParameter (unsigned long paramId) const |
template<AnsiStringLike StringT> | |
StringT | GetSystemStringParameter (unsigned long paramId) const |
void | SetSystemParameter (unsigned long paramId, unsigned long long value) const |
void | SetSystemParameter (unsigned long paramId, const wchar_t *value) const |
void | SetSystemParameter (unsigned long paramId, const char *value) const |
template<SimpleStringLike StringT> | |
void | SetSystemParameter (unsigned long paramId, const StringT &value) const |
Static Private Member Functions | |
static unsigned long long | GetGlobalSystemNumericParameter (unsigned long paramId) |
static void | SetGlobalSystemParameter (unsigned long paramId, unsigned long long value) |
Private Attributes | |
JET_INSTANCE | instance_ |
bool | initialized_ |
InitFlags | initFlags_ |
An instance of the database engine for use in a single process.
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
delete |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenodiscard |
Starts a session and initializes and returns a new Session object for the handle.
Sessions control all access to the database and are used to control the scope of transactions. The session can be used to begin, commit, or abort transactions. The session is also used to attach, create, or open a database. The session is used as the context for all DDL and DML operations. To increase concurrency and parallel access to the database, multiple sessions can be begun.
|
inlinestaticprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inlineprivate |
|
inlineconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
|
inline |
|
inline |
|
inline |
This parameter sets the three letter prefix used for many of the files used by the database engine. For example, the checkpoint file is called EDB.CHK by default because EDB is the default base name. The base name can be used to easily distinguish between sets of files that belong to different instances or to different applications.
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
This parameter configures how transaction log files are managed by the database engine.
When circular logging is off, all transaction log files that are generated are retained on disk until they are no longer needed because a full backup of the database has been performed. In this mode, it is possible to restore from an older backup and play forward through all the retained transaction log files such that no data is lost as a result of the disaster that forced the restore. Regular full backups are required to prevent the disk from filling up with transaction log files.
When circular logging is on, only transaction log files that are younger than the current checkpoint are retained on disk.The benefit of this mode is that backups are not required to retire old transaction log files.The tradeoff is that a zero data loss restore is no longer possible.
|
inline |
|
inline |
|
inline |
When this parameter is set to true then any folder that is missing in a file system path in use by the database engine will be silently created. Otherwise, the operation that uses the missing file system path will throw an Ese::Exception for Result::ErrorInvalidPath.
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
This setting controls what happens when an exception is thrown by the database engine or code that is called by the database engine. When set to ExceptionAction::DisplayMessageBox, any exception will be thrown to the Windows unhandled exception filter.This will result in the exception being handled as an application failure.The intent is to prevent application code from erroneously trying to catch and ignore an exception generated by the database engine.This cannot be allowed because database corruption could occur.If the application wishes to properly handle these exceptions then the protection can be disabled by setting this parameter to ExceptionAction::None.
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
This parameter indicates the relative or absolute file system path of the folder that will contain the transaction logs for the instance.
The path must be terminated with a backslash character, which indicates that the target path is a folder. The transaction log files contain the information required to bring the database files to a consistent state after a crash. They are typically named EDB*.LOG. The contents of the transaction log files are just as important (if not more so) than the database files themselves. Every effort should be made to protect them.
There will also be additional reserve log files named RES1.LOGand RES2.LOG stored along with the ordinary log files.The contents of these files are not important as their only purpose is to reserve disk space to allow the engine to shut down gracefully in a low disk scenario.These will also be a temporary log file typically named EDBTMP.LOG in this same folder. The contents of this file are not important either.This file is a new log file being prepared for use.
The properties of the host volume of the transaction log files and their placement relative to the other files used by the database engine can dramatically impact performance.
Note:If a relative path is specified then it will be relative to the current working directory of the process that hosts the application that is using the database engine.
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
This setting controls the number of B+ Tree resources cached by the instance after the tables they represent have been closed by the application.
Large values for this setting will cause the database engine to use more memory but will increase the speed with which a large number of tables can be opened randomly by the application.This is useful for applications that have a schema with a very large number of tables.
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
This parameter attempts to keep the number of B+ Tree resources in use below the specified threshold.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
This parameter indicates the relative or absolute file system path of the folder that will contain the checkpoint file for the instance. The path must be terminated with a backslash character, which indicates that the target path is a folder. The checkpoint file is a simple file maintained per instance that remembers the oldest transaction log file that must be replayed to bring all databases in that instance to a consistent state after a crash. The checkpoint file is typically named EDB.CHK.
If a relative path is specified then it will be relative to the current working directory of the process that hosts the application that is using the database engine.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
This parameter configures how transaction log files are managed by the database engine.
When circular logging is off, all transaction log files that are generated are retained on disk until they are no longer needed because a full backup of the database has been performed. In this mode, it is possible to restore from an older backup and play forward through all the retained transaction log files such that no data is lost as a result of the disaster that forced the restore. Regular full backups are required to prevent the disk from filling up with transaction log files.
When circular logging is on, only transaction log files that are younger than the current checkpoint are retained on disk.The benefit of this mode is that backups are not required to retire old transaction log files.The tradeoff is that a zero data loss restore is no longer possible.
value | The new value to assign to the CircularLog parameter |
|
inline |
|
inline |
|
inline |
When this parameter is set to true then any folder that is missing in a file system path in use by the database engine will be silently created. Otherwise, the operation that uses the missing file system path will throw an Ese::Exception for Result::ErrorInvalidPath.
value | value to assign to the CreatePathIfNotExist parameter |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
This setting controls what happens when an exception is thrown by the database engine or code that is called by the database engine. When set to ExceptionAction::DisplayMessageBox, any exception will be thrown to the Windows unhandled exception filter.This will result in the exception being handled as an application failure.The intent is to prevent application code from erroneously trying to catch and ignore an exception generated by the database engine.This cannot be allowed because database corruption could occur.If the application wishes to properly handle these exceptions then the protection can be disabled by setting this parameter to ExceptionAction::None.
|
inlinestatic |
|
inlinestaticprivate |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
This parameter indicates the relative or absolute file system path of the folder that will contain the transaction logs for the instance.
The path must be terminated with a backslash character, which indicates that the target path is a folder. The transaction log files contain the information required to bring the database files to a consistent state after a crash. They are typically named EDB*.LOG. The contents of the transaction log files are just as important (if not more so) than the database files themselves. Every effort should be made to protect them.
There will also be additional reserve log files named RES1.LOGand RES2.LOG stored along with the ordinary log files.The contents of these files are not important as their only purpose is to reserve disk space to allow the engine to shut down gracefully in a low disk scenario.These will also be a temporary log file typically named EDBTMP.LOG in this same folder. The contents of this file are not important either.This file is a new log file being prepared for use.
The properties of the host volume of the transaction log files and their placement relative to the other files used by the database engine can dramatically impact performance.
Note:If a relative path is specified then it will be relative to the current working directory of the process that hosts the application that is using the database engine.
value | The value to assign to the LogFilePath parameter |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
This setting controls the number of B+ Tree resources cached by the instance after the tables they represent have been closed by the application.
Large values for this setting will cause the database engine to use more memory but will increase the speed with which a large number of tables can be opened randomly by the application.This is useful for applications that have a schema with a very large number of tables.
value | The new value to assign to the CachedClosedTables parameter |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inline |
This parameter indicates the relative or absolute file system path of the folder that will contain the checkpoint file for the instance. The path must be terminated with a backslash character, which indicates that the target path is a folder. The checkpoint file is a simple file maintained per instance that remembers the oldest transaction log file that must be replayed to bring all databases in that instance to a consistent state after a crash. The checkpoint file is typically named EDB.CHK.
If a relative path is specified then it will be relative to the current working directory of the process that hosts the application that is using the database engine.
value | The new value to assign to the SystemPath parameter |
|
inline |
|
inline |
boost::signals2::signal<void( const Instance* instance )> Harlinn::Common::Core::Ese::Instance::AfterInit |
boost::signals2::signal<void( const Instance* instance )> Harlinn::Common::Core::Ese::Instance::BeforeInit |
|
private |
|
mutableprivate |
|
private |