예제 #1
0
파일: EventStore.cs 프로젝트: mbsky/DensoDB
        internal EventStore(string dbname, long lastcommittedcommandsn)
        {
            DatabaseName = dbname;

              LastExecutedCommandSN = lastcommittedcommandsn;
              LoadUncommittedEventsFromJournal();

              _eventHandlerThread = new Thread(new ThreadStart(ExecuteEventCommands));
              _eventHandlerThread.Start();

              _journal = new Journaling(Configuration.BasePath, dbname);
        }
예제 #2
0
        internal EventStore(string dbname, long lastcommittedcommandsn)
        {
            DatabaseName = dbname;

              LastExecutedCommandSN = lastcommittedcommandsn;
              long jsn = LoadUncommittedEventsFromJournal();

              _eventHandlerThread = new Thread(new ThreadStart(ExecuteEventCommands));
              _eventHandlerThread.Start();

              _journal = new Journaling(Configuration.BasePath, dbname);

              _operationsLog = new Journaling(Configuration.BasePath, dbname);

              // The journal can be empty so i have to evaluate the last committed command serial number
              // and reset Command Serial number in the journal to ensure command execution coherency.
              _journal.CommandSN = Math.Max(jsn, lastcommittedcommandsn);
        }