Exemple #1
0
 public override TransactionCommitProcess Create(TransactionAppender appender, StorageEngine storageEngine, Config config)
 {
     if (config.Get(GraphDatabaseSettings.read_only))
     {
         return(new ReadOnlyTransactionCommitProcess());
     }
     return(new TransactionRepresentationCommitProcess(appender, storageEngine));
 }
 internal NeoStoreTransactionLogModule(LogicalTransactionStore logicalTransactionStore, LogFiles logFiles, LogRotation logRotation, CheckPointerImpl checkPointer, TransactionAppender appender, SynchronizedArrayIdOrderingQueue explicitIndexTransactionOrdering)
 {
     this._logicalTransactionStore = logicalTransactionStore;
     this._logFiles     = logFiles;
     this._logRotation  = logRotation;
     this._checkPointer = checkPointer;
     this._appender     = appender;
     this._explicitIndexTransactionOrdering = explicitIndexTransactionOrdering;
 }
Exemple #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldFailWithProperMessageOnAppendException() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldFailWithProperMessageOnAppendException()
        {
            // GIVEN
            TransactionAppender appender  = mock(typeof(TransactionAppender));
            IOException         rootCause = new IOException("Mock exception");

            doThrow(new IOException(rootCause)).when(appender).append(any(typeof(TransactionToApply)), any(typeof(LogAppendEvent)));
            StorageEngine            storageEngine = mock(typeof(StorageEngine));
            TransactionCommitProcess commitProcess = new TransactionRepresentationCommitProcess(appender, storageEngine);

            // WHEN
            try
            {
                commitProcess.Commit(MockedTransaction(), _commitEvent, INTERNAL);
                fail("Should have failed, something is wrong with the mocking in this test");
            }
            catch (TransactionFailureException e)
            {
                assertThat(e.Message, containsString("Could not append transaction representation to log"));
                assertTrue(contains(e, rootCause.Message, rootCause.GetType()));
            }
        }