use of org.neo4j.kernel.impl.query.QueryExecutionKernelException in project neo4j by neo4j.
the class SnapshotExecutionEngineTest method failWriteQueryAfterFirstRetry.
@Test
void failWriteQueryAfterFirstRetry() throws QueryExecutionKernelException {
when(statistics.containsUpdates()).thenReturn(true);
when(versionContext.isDirty()).thenReturn(true, true, false);
QueryExecutionKernelException e = assertThrows(QueryExecutionKernelException.class, () -> executionEngine.executeWithRetries("query", transactionalContext, executor));
assertEquals("Unable to get clean data snapshot for query 'query' that performs updates.", e.getMessage());
verify(executor, times(1)).execute(any());
verify(versionContext, times(1)).initRead();
}
use of org.neo4j.kernel.impl.query.QueryExecutionKernelException in project neo4j by neo4j.
the class TransactionStateMachineTest method shouldThrowOnCommitInAutoCommit.
@Test
void shouldThrowOnCommitInAutoCommit() {
QueryExecutionKernelException e = assertThrows(QueryExecutionKernelException.class, () -> TransactionStateMachine.State.AUTO_COMMIT.commitTransaction(mutableState, stateMachineSPI));
assertEquals("No current transaction to commit.", e.getMessage());
}
use of org.neo4j.kernel.impl.query.QueryExecutionKernelException in project neo4j by neo4j.
the class TransactionStateMachineTest method shouldThrowOnBeginInExplicitTransaction.
@Test
void shouldThrowOnBeginInExplicitTransaction() {
QueryExecutionKernelException e = assertThrows(QueryExecutionKernelException.class, () -> TransactionStateMachine.State.EXPLICIT_TRANSACTION.beginTransaction(mutableState, stateMachineSPI, null, null, AccessMode.WRITE, null));
assertEquals("Nested transactions are not supported.", e.getMessage());
}
Aggregations