Source:
State run( MutableTransactionState ctx, SPI spi, String statement, MapValue params ) throws KernelException { if ( BEGIN.matcher( statement ).matches() ) { AnyValue txTimeoutMills = params.get( TX_TIMEOUT_MILLIS ); if ( txTimeoutMills instanceof LongValue ) { ctx.currentTransaction = spi.beginTransaction( ctx.securityContext, ((LongValue) txTimeoutMills).value(), TimeUnit.MILLISECONDS ); } else { ctx.currentTransaction = spi.beginTransaction( ctx.securityContext ); } Bookmark bookmark = Bookmark.fromParamsOrNull( params ); if ( bookmark != null ) { spi.awaitUpToDate( bookmark.txId() ); ctx.currentResult = new BookmarkResult( bookmark ); } else { ctx.currentResult = BoltResult.EMPTY; } return EXPLICIT_TRANSACTION; } else if ( COMMIT.matcher( statement ).matches() ) { throw new QueryExecutionKernelException( new InvalidSemanticsException( "No current transaction to commit." ) ); } else if ( ROLLBACK.matcher( statement ).matches() ) { ctx.currentResult = BoltResult.EMPTY; return AUTO_COMMIT; } else { if ( statement.isEmpty() ) { statement = ctx.lastStatement; } else { ctx.lastStatement = statement; } if ( spi.isPeriodicCommit( statement ) ) { BoltResultHandle resultHandle = executeQuery( ctx, spi, statement, params, noop() ); ctx.currentResultHandle = resultHandle; ctx.currentResult = resultHandle.start(); ctx.currentTransaction = null; return AUTO_COMMIT; } else { ctx.currentTransaction = spi.beginTransaction( ctx.securityContext ); BoltResultHandle resultHandle = execute( ctx, spi, statement, params ); ctx.currentResultHandle = resultHandle; ctx.currentResult = resultHandle.start(); return AUTO_COMMIT; } } }

Target:
State run( MutableTransactionState ctx, SPI spi, String statement, MapValue params ) throws KernelException { if ( BEGIN.matcher( statement ).matches() ) { AnyValue txTimeoutMills = params.get( TX_TIMEOUT_MILLIS ); if ( txTimeoutMills == Values.NO_VALUE ) { ctx.currentTransaction = spi.beginTransaction( ctx.securityContext ); } else if ( txTimeoutMills instanceof IntegralValue ) { ctx.currentTransaction = spi.beginTransaction( ctx.securityContext, ((IntegralValue) txTimeoutMills).longValue(), TimeUnit.MILLISECONDS ); } else { throw new QueryExecutionKernelException( new InvalidSemanticsException( "Invalid transaction timeout type. Expecting to be an integer, but got " + txTimeoutMills.toString() ) ); } Bookmark bookmark = Bookmark.fromParamsOrNull( params ); if ( bookmark != null ) { spi.awaitUpToDate( bookmark.txId() ); ctx.currentResult = new BookmarkResult( bookmark ); } else { ctx.currentResult = BoltResult.EMPTY; } return EXPLICIT_TRANSACTION; } else if ( COMMIT.matcher( statement ).matches() ) { throw new QueryExecutionKernelException( new InvalidSemanticsException( "No current transaction to commit." ) ); } else if ( ROLLBACK.matcher( statement ).matches() ) { ctx.currentResult = BoltResult.EMPTY; return AUTO_COMMIT; } else { if ( statement.isEmpty() ) { statement = ctx.lastStatement; } else { ctx.lastStatement = statement; } if ( spi.isPeriodicCommit( statement ) ) { BoltResultHandle resultHandle = executeQuery( ctx, spi, statement, params, noop() ); ctx.currentResultHandle = resultHandle; ctx.currentResult = resultHandle.start(); ctx.currentTransaction = null; return AUTO_COMMIT; } else { ctx.currentTransaction = spi.beginTransaction( ctx.securityContext ); BoltResultHandle resultHandle = execute( ctx, spi, statement, params ); ctx.currentResultHandle = resultHandle; ctx.currentResult = resultHandle.start(); return AUTO_COMMIT; } } }