Questions tagged [r2dbc]

R2DBC (Reactive Relational Database Connectivity) is an SPI which enables interacting with SQL database servers by executing SQL statements using a non-blocking reactive programming model with the Java programming language.

R2DBC is a Java-based, open source data access technology.

This technology is an SPI (Service Provider Interface) for the Java programming language that defines how a client may access a database using reactive programming. It specifies SPI methods for executing queries using a non-blocking driver. R2DBC is oriented towards relational databases.

Online resources

379 questions
8
votes
4 answers

Multi-tenant schema-based application with r2dbc

I'm working on a multi-tenant reactive application using Spring-Webflux + Spring-data-r2dbc with the r2dbc driver to connect to a Postgresql database. The multi-tenant part is schema-based: one schema per tenant. So depending of the context (the…
Arnaud42
  • 101
  • 1
  • 4
7
votes
1 answer

Spring boot r2dbc transactional: which method to annotate

I am using spring-boot 2.4.2 with webflux to connect to a postgres database. I observed a behavior while using @Transactional that I don't understand. To showcase the behavior, I created an example application that attempts to add rows to two…
alampada
  • 2,329
  • 1
  • 23
  • 18
7
votes
2 answers

H2-console in r2dbc-h2 driver

I am using R2DBC-H2 driver, and my UR.L is spring.r2dbc.url=r2dbc:h2:mem:///customer Using this configuration, SpringBoot starts fine, however, I can not access the h2-console. Does anybody know why, and how I can fix it?
GtdDev
  • 748
  • 6
  • 14
7
votes
1 answer

Best practice of handling relations between tables in Spring Data R2dbc

I tried to create a user/roles relation in RDBMS and want to use R2dbc(Spring Data R2dbc) to shake hands with the backend database. Assume there are three tables, users, roles, and user_roles. @Table("users") class User { @Id private String…
Hantsy
  • 8,006
  • 7
  • 64
  • 109
7
votes
5 answers

Connection pool size with postgres r2dbc-pool

I'm not able to open more than 10 connections with spring-webflux and r2dbc (with r2dbc-pool driver 0.8.0.M8). My config looks like: @Configuration public class PostgresConfig extends AbstractR2dbcConfiguration { @Override @Bean public…
Nikita
  • 4,435
  • 3
  • 24
  • 44
6
votes
2 answers

Why there are multiple calls to DB

I am playing with R2DBC using Postgre SQL. The usecase i am trying is to get the Film by ID along with Language, Actors and Category. Below is the schema this is the corresponding piece of code in ServiceImpl @Override public Mono
6
votes
2 answers

R2DBC vs Spring Jdbc Vs Spring Data JDBC?

On Using Spring JDBC which works very well and has some improvements over JPA when using Batch processing. I would love to learn why to use Spring Data JDBC when you already have Spring JDBC. I would love to learn why to use R2DBC when you already…
Jeff Cook
  • 7,956
  • 36
  • 115
  • 186
6
votes
4 answers

Unable to create a ConnectionFactory Error with H2 and R2DBC in Spring Boot with WebFlux

I've created a Java Spring Boot service using the WebFlux reactive module, H2 in-memory database, and R2DBC reactive driver. When I run the service, it fails with an "Unable to create a ConnectionFactory" error: Unable to create a ConnectionFactory…
Doug Wilson
  • 71
  • 1
  • 6
6
votes
1 answer

Closing a connection from R2DBC pool

I'm trying to configure R2DBC connection to PostgreSQL database with connection pool. I have followed this documentation: https://github.com/r2dbc/r2dbc-pool/blob/main/README.md. ConnectionFactory connectionFactory =…
Olek
  • 319
  • 8
  • 24
6
votes
4 answers

R2DBC and liquibase

So starting a new project and i want to use r2dbc and webflux, been looking into what support there is to handle database migration. The last answer i could find here was from july 2019 that liquibase does not support R2DBC and after googling, this…
Toerktumlare
  • 12,548
  • 3
  • 35
  • 54
6
votes
2 answers

How to map One to Many / One to One to a POJO in Spring Data R2DBC

I am trying to replicate some functionality that I was using in Spring Data JPA in the new reactive Data r2dbc. I am aware that r2dbc is not a full-fledged ORM but wanted to understand as what could be the best way to replicate the below scenario in…
abstractKarshit
  • 1,355
  • 2
  • 16
  • 34
6
votes
2 answers

Ignore field for update in spring-r2dbc

I am using spring r2dbc and ReactiveCrudRepository, I have a field which I need to ignore for when update query is generated @Data @Table(PRODUCT_TABLE) public class ProductEntity { @Id @GeneratedValue(strategy = GenerationType.AUTO) // Id…
6
votes
3 answers

R2DBC and enum (PostgreSQL)

Update 15/08/2020: Looks like Enum support was added on Jun 16. R2DBC commit. Does H2DBC support PostgreSQL enums? I checked they git page but it doesn't mention anything about it. If it does, how enums could be used (INSERT, SELECT)? Lets say…
my-
  • 604
  • 9
  • 17
6
votes
2 answers

R2dbc H2 issues when using inMemory database

I was trying to taste R2dbc and using Embedded H2 like: public ConnectionFactory connectionFactory() { //ConnectionFactory factory = ConnectionFactories.get("r2dbc:h2:mem:///test?options=DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE"); …
Hantsy
  • 8,006
  • 7
  • 64
  • 109
6
votes
3 answers

How to extract jsonb from Postgresql to Spring webflux using R2dbc

So I had this idea that's way over my head really since I've only been programming for a short while but I wanted to build a reactive Spring webflux app that exposes json endpoints to a react frontend. The problem started when I decided to use the…
Xenofono
  • 169
  • 2
  • 9
1
2
3
25 26