Skip to content
Advertisement

Updating webclient response from database

I have situation where I can’t update column at database. The problem is that only method setIsPurchased is executed and the flag is_purchase at SQL table changed to true, but the next line with setPurchasedDate which has to set current time is not executed. The response from database is Mono<Void> type.

Queries for those two method are simple and looks like:

For setIsPurchased:

update extra_product_transactions SET is_purchased = 1 where uuid = :uuid

For setPurchasedDate:

update extra_product_transactions SET purchased_date = CURRENT_TIMESTAMP where uuid = :uuid

Advertisement

Answer

A Mono<Void> by essence never emits an element onNext(). Having said that, .flatMap { extraProductTransactionService.setPurchasedDate(uuid) } is never invoked.

I assume you are not interested in the return values of the set methods so you can do something like:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement