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 ) ) else if ( statement.equalsIgnoreCase( ROLLBACK ) )
{ {
throw new QueryExecutionKernelException( ctx.currentResult = BoltResult.EMPTY;
new InvalidSemanticsException( "No current transaction to rollback." ) ); return AUTO_COMMIT;
} }
else else
{ {
Expand Down
Expand Up @@ -121,7 +121,7 @@ public void shouldHandleBeginRollback() throws Throwable
} }


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


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


@Test @Test
Expand Down

0 comments on commit 34a14b9

Please sign in to comment.