From e9b36b5f2a26140bf507ddae539c86ba3ef01782 Mon Sep 17 00:00:00 2001 From: Raja Kolli Date: Wed, 8 Nov 2023 15:52:26 +0000 Subject: [PATCH] fix : issue with @Transaction proxy --- .../com/example/bootr2dbc/services/ReactivePostService.java | 4 +++- .../src/test/java/com/example/bootr2dbc/TestApplication.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/r2dbc/boot-r2dbc-sample/src/main/java/com/example/bootr2dbc/services/ReactivePostService.java b/r2dbc/boot-r2dbc-sample/src/main/java/com/example/bootr2dbc/services/ReactivePostService.java index 313b28abd..8773e37b1 100644 --- a/r2dbc/boot-r2dbc-sample/src/main/java/com/example/bootr2dbc/services/ReactivePostService.java +++ b/r2dbc/boot-r2dbc-sample/src/main/java/com/example/bootr2dbc/services/ReactivePostService.java @@ -66,7 +66,9 @@ public Mono> deleteReactivePostAndCommentsById(Long id) { reactivePost -> reactiveCommentsRepository .deleteAllByPostId(reactivePost.getId()) - .then(deleteReactivePostById(reactivePost.getId())) + .then( + reactivePostRepository.deleteById( + reactivePost.getId())) .then(Mono.just(ResponseEntity.noContent().build()))) .switchIfEmpty(Mono.just(ResponseEntity.notFound().build())); } diff --git a/r2dbc/boot-r2dbc-sample/src/test/java/com/example/bootr2dbc/TestApplication.java b/r2dbc/boot-r2dbc-sample/src/test/java/com/example/bootr2dbc/TestApplication.java index 11eb0c211..254d82d36 100644 --- a/r2dbc/boot-r2dbc-sample/src/test/java/com/example/bootr2dbc/TestApplication.java +++ b/r2dbc/boot-r2dbc-sample/src/test/java/com/example/bootr2dbc/TestApplication.java @@ -12,7 +12,7 @@ public class TestApplication { @Bean @ServiceConnection PostgreSQLContainer postgreSQLContainer() { - return new PostgreSQLContainer<>("postgres:15.4-alpine"); + return new PostgreSQLContainer<>("postgres:16.0-alpine"); } public static void main(String[] args) {