Questions tagged [r2dbc-postgresql]

For questions regarding the PostgreSQL implementation of the R2DBC SPI. See also tags "r2dbc" and "postgresql".

Refers to the PostgreSQL implementation of the R2DBC SPI. Refer to the tag info for r2dbc for information on Reactive Relational Database Connectivity Service Provider Interface and refer to tag info for postgresql for information on PostgreSQL object-relational database management system.

103 questions
8
votes
2 answers

R2dbc custom converter

How can I add my custom converter to mu spring boot application? My entity field @CreatedDate @Column(value = "create_time") private Instant createTime; My converters are @Bean public Converter
Vurtatoo
  • 346
  • 3
  • 8
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
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
5
votes
1 answer

Get fail constraint name from DataIntegrityViolationException with spring-data-r2dbc and postgresql

I have some constraints in a postgresql database (unique, foreign key...). I use spring data r2dbc repository : ReactiveCrudRepository I would like to transform the DataIntegrityViolationException throw by the repository to some custom exception…
fpa
  • 51
  • 3
4
votes
1 answer

Spring R2DBC doesn't support multiple host/failover

I'm using spring r2dbc in my project and trying to make it work with multiple host/failover postgres topology; in other words, where the db url is like this: r2dbc:postgresql:failover://host1,host2,host3:port/ I'm using 2.7.5 version of spring boot,…
mr.nothing
  • 5,141
  • 10
  • 53
  • 77
4
votes
1 answer

Spring R2dbc: Is there are way to get constant stream from postgresql database and process them?

I want to fetch records for newly created records in a table in postgresql as a live/continuous stream. Is it possible to use using spring r2dbc? If so what options do I have? Thanks
4
votes
0 answers

R2DBC - PostgreSQL - Cannot exchange messages because the request queue limit is exceeded

Libraries: r2dbc-postgresql-0.8.6.RELEASE r2dbc-pool-0.8.5.RELEASE r2dbc-spi-0.8.3.RELEASE postgresql-42.2.18 List item Problem: I tried to bulk insert using R2DBC (PostgreSQL) with code as below: @Override public Flux test(List users)…
4
votes
2 answers

How to enable connection pooling with spring-boot-starter-data-r2dbc?

I have a Spring Boot application with data-r2dbc dependency. I use PostgreSQL as DB. So I already have in place the following dependencies (gradle…
fyrkov
  • 2,245
  • 16
  • 41
4
votes
1 answer

Connection-reuse and transactions (relationship)

How does R2DBC implement transaction-handling. As far as I know, JDBC use one connection for one transaction. So in Spring MVC we have the following mapping: 1 request : 1 thread : 1 transaction : 1 connection. What is the mapping in Webflux with…
3
votes
2 answers

Spring r2dbc custom Json converter not working

I am trying to insert json into json column using spring webflux with postgres sql. I have created custom converter for reading and writing. The issue is existing json values becomes null, whenever trying to update the record. The new value is…
3
votes
0 answers

Using $1 in the @Query throws exception: Cannot encode parameter of type org.springframework.r2dbc.core.Parameter

I'm using R2DBC in my project. After upgrading to Spring Boot from 2.5.* to 2.6.1 my query: @Query("SELECT EXISTS(SELECT 1 FROM some_link links WHERE links.data_id = $1 AND links.some_id != links.source_id)") fun…
Pawel
  • 466
  • 1
  • 7
  • 20
3
votes
0 answers

Spring Data R2DBC - Building custom postgresql query with array of strings

I use R2DBC repository: @Repository public interface StockRepo extends ReactiveCrudRepository { Flux searchByArrayValueIgnoreCase(String[] arr); } I need to create custom query to postgres like "select * from stocks where title…
Serg
  • 77
  • 1
  • 6
3
votes
1 answer

How to implement ManyToMany in r2dbc

R2DBC does not support composite keys currently. I wonder how we may implement a many-to-many relationship for now? For example, given the two entities: @Table class Item( @Id var id: Long?, var title: String, var description:…
Stuck
  • 11,225
  • 11
  • 59
  • 104
3
votes
3 answers

initialize database for testing purpose on Spring Data R2DBC

In a non-test environment, I can set up the bean to initialize the database with the schema.sql like this @Bean ConnectionFactoryInitializer initializer(@Qualifier("connectionFactory") ConnectionFactory connectionFactory) { …
kamalhm
  • 126
  • 2
  • 10
3
votes
1 answer

Spring Boot 2.4 mixed project with JPA and R2DBC doesn't start

I'm working on an existing Spring Boot 2.4 project and trying to bring in Webflux and R2DBC into an existing JPA based app. I'm able to bring in the Webflux dependency: org.springframework.boot
1
2 3 4 5 6 7