Skip to content

Commit

Permalink
don't fail on ROLLBACK when in AUTO-COMMIT mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-ince committed Nov 9, 2017
1 parent d13fa50 commit 34a14b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Expand Up @@ -208,8 +208,8 @@ else if ( statement.equalsIgnoreCase( COMMIT ) )
}
else if ( statement.equalsIgnoreCase( ROLLBACK ) )
{
throw new QueryExecutionKernelException(
new InvalidSemanticsException( "No current transaction to rollback." ) );
ctx.currentResult = BoltResult.EMPTY;
return AUTO_COMMIT;
}
else
{
Expand Down
Expand Up @@ -121,7 +121,7 @@ public void shouldHandleBeginRollback() throws Throwable
}

@Test
public void shouldFailNicelyWhenOutOfOrderRollback() throws Throwable
public void shouldNotFailWhenOutOfOrderRollbackInAutoCommitMode() throws Throwable
{
// Given
BoltResponseRecorder runRecorder = new BoltResponseRecorder();
Expand All @@ -134,8 +134,8 @@ public void shouldFailNicelyWhenOutOfOrderRollback() throws Throwable
machine.pullAll( pullAllRecorder );

// Then
assertThat( runRecorder.nextResponse(), failedWithStatus( Status.Statement.SemanticError ) );
assertThat( pullAllRecorder.nextResponse(), wasIgnored() );
assertThat( runRecorder.nextResponse(), succeeded() );
assertThat( pullAllRecorder.nextResponse(), succeeded() );
}

@Test
Expand Down

0 comments on commit 34a14b9

Please sign in to comment.