Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TemporaryDatabase"/> class.
 /// </summary>
 /// <param name="isamSession">The session.</param>
 internal TemporaryDatabase(IsamSession isamSession)
     : base(isamSession)
 {
     lock (isamSession)
     {
         this.cleanup                   = true;
         this.tableCollection           = new TableCollection();
         this.tempTableHandleCollection = new TempTableHandleCollection(false);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Creates the specified checkpoint file directory path.
        /// </summary>
        /// <param name="checkpointFileDirectoryPath">The checkpoint file directory path.</param>
        /// <param name="logfileDirectoryPath">The logfile directory path.</param>
        /// <param name="temporaryDatabaseFileDirectoryPath">The temporary database file directory path.</param>
        /// <param name="baseName">Name of the base.</param>
        /// <param name="eventSource">The event source.</param>
        /// <param name="isReadOnly">if set to <c>true</c> [is read only].</param>
        /// <param name="pageSize">Size of the page.</param>
        private void Create(
            string checkpointFileDirectoryPath,
            string logfileDirectoryPath,
            string temporaryDatabaseFileDirectoryPath,
            string baseName,
            string eventSource,
            bool isReadOnly,
            int pageSize)
        {
            lock (this)
            {
                try
                {
                    Miei.SystemParameters.Configuration    = 0;
                    Miei.SystemParameters.DatabasePageSize = pageSize;
                }
                catch (EsentAlreadyInitializedException)
                {
                }

                this.readOnly = isReadOnly;
                Api.JetCreateInstance(out this.instance, eventSource);
                this.cleanupInstance           = true;
                this.instanceInitialized       = false;
                this.isamSystemParameters      = new IsamSystemParameters(this);
                this.tempTableHandleCollection = new TempTableHandleCollection(true);
                this.cleanupTempTables         = true;

                this.isamSystemParameters.CreatePathIfNotExist = true;
                this.isamSystemParameters.PageTempDBMin        = 14;
                this.isamSystemParameters.LogFileSize          = 64;
                this.isamSystemParameters.CircularLog          = true;
                this.isamSystemParameters.SystemPath           = checkpointFileDirectoryPath;
                this.isamSystemParameters.LogFilePath          = logfileDirectoryPath;
                this.isamSystemParameters.TempPath             = temporaryDatabaseFileDirectoryPath;
                this.isamSystemParameters.BaseName             = baseName;
                this.isamSystemParameters.EventSource          = eventSource;
                this.isamSystemParameters.Recovery             = this.readOnly ? "off" : "on";
            }
        }
Beispiel #3
0
        /// <summary>
        /// Creates the specified checkpoint file directory path.
        /// </summary>
        /// <param name="checkpointFileDirectoryPath">The checkpoint file directory path.</param>
        /// <param name="logfileDirectoryPath">The logfile directory path.</param>
        /// <param name="temporaryDatabaseFileDirectoryPath">The temporary database file directory path.</param>
        /// <param name="baseName">Name of the base.</param>
        /// <param name="eventSource">The event source.</param>
        /// <param name="isReadOnly">if set to <c>true</c> [is read only].</param>
        /// <param name="pageSize">Size of the page.</param>
        private void Create(
            string checkpointFileDirectoryPath,
            string logfileDirectoryPath,
            string temporaryDatabaseFileDirectoryPath,
            string baseName,
            string eventSource,
            bool isReadOnly,
            int pageSize)
        {
            lock (this)
            {
                try
                {
                    Miei.SystemParameters.Configuration = 0;
                    Miei.SystemParameters.DatabasePageSize = pageSize;
                }
                catch (EsentAlreadyInitializedException)
                {
                }

                this.readOnly = isReadOnly;
                Api.JetCreateInstance(out this.instance, eventSource);
                this.cleanupInstance = true;
                this.instanceInitialized = false;
                this.isamSystemParameters = new IsamSystemParameters(this);
                this.tempTableHandleCollection = new TempTableHandleCollection(true);
                this.cleanupTempTables = true;

                this.isamSystemParameters.CreatePathIfNotExist = true;
                this.isamSystemParameters.PageTempDBMin = 14;
                this.isamSystemParameters.LogFileSize = 64;
                this.isamSystemParameters.CircularLog = true;
                this.isamSystemParameters.SystemPath = checkpointFileDirectoryPath;
                this.isamSystemParameters.LogFilePath = logfileDirectoryPath;
                this.isamSystemParameters.TempPath = temporaryDatabaseFileDirectoryPath;
                this.isamSystemParameters.BaseName = baseName;
                this.isamSystemParameters.EventSource = eventSource;
                this.isamSystemParameters.Recovery = this.readOnly ? "off" : "on";
            }
        }