use of org.neo4j.bolt.runtime.Bookmark in project neo4j by neo4j.
the class TransactionStateMachineV3SPITest method shouldNotCheckDatabaseIdInBookmark.
@Test
void shouldNotCheckDatabaseIdInBookmark() {
// Given
var dbSpi = mock(BoltGraphDatabaseServiceSPI.class);
var spi = new TestAbstractTransactionStateMachineSPI(dbSpi, mock(BoltChannel.class), mock(SystemNanoClock.class), mock(StatementProcessorReleaseManager.class));
var bookmarks = List.<Bookmark>of(new BookmarkWithPrefix(42L));
// When
spi.beginTransaction(null, bookmarks, null, null, null, null);
// Then
verify(dbSpi).beginTransaction(any(), any(), any(), eq(bookmarks), any(), any(), any(), any());
}
use of org.neo4j.bolt.runtime.Bookmark in project neo4j by neo4j.
the class TransactionReadyState method processCommitMessage.
private BoltStateMachineState processCommitMessage(StateMachineContext context) throws KernelException {
StatementProcessor statementProcessor = context.connectionState().getStatementProcessor();
Bookmark bookmark = statementProcessor.commitTransaction();
bookmark.attachTo(context.connectionState());
return readyState;
}
use of org.neo4j.bolt.runtime.Bookmark in project neo4j by neo4j.
the class StreamingState method processStreamResultMessage.
@Override
protected BoltStateMachineState processStreamResultMessage(ResultConsumer resultConsumer, StateMachineContext context) throws Throwable {
int statementId = StatementMetadata.ABSENT_QUERY_ID;
Bookmark bookmark = context.connectionState().getStatementProcessor().streamResult(statementId, resultConsumer);
bookmark.attachTo(context.connectionState());
return readyState;
}
use of org.neo4j.bolt.runtime.Bookmark in project neo4j by neo4j.
the class InTransactionState method processCommitMessage.
private BoltStateMachineState processCommitMessage(StateMachineContext context) throws KernelException {
StatementProcessor statementProcessor = context.connectionState().getStatementProcessor();
Bookmark bookmark = statementProcessor.commitTransaction();
bookmark.attachTo(context.connectionState());
return readyState;
}
use of org.neo4j.bolt.runtime.Bookmark in project neo4j by neo4j.
the class AutoCommitState method processStreamResultMessage.
@Override
protected BoltStateMachineState processStreamResultMessage(int statementId, ResultConsumer resultConsumer, StateMachineContext context) throws Throwable {
Bookmark bookmark = context.connectionState().getStatementProcessor().streamResult(statementId, resultConsumer);
if (resultConsumer.hasMore()) {
return this;
}
bookmark.attachTo(context.connectionState());
return readyState;
}
Aggregations