Questions tagged [r2dbc-postgresql]

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

r2dbc-postgresql
Filter by
Sorted by
Tagged with
-3 votes
1 answer
67 views

unable to start my java spring boot project from spring initlizar

this is coming i got the jist of it some kind of driver not found but i am unable to fix it need help 2024-03-25T21:40:09.961+05:30 INFO 24152 --- [ main] .s.d.r.c....
lakshit gupta's user avatar
0 votes
0 answers
13 views

Encoding error on updating custom_enum[] column while updating. Cannot encode parameter of type java.util.ArrayList ([TYPE1])))

Insertion part is working properly but when I update custom enum set column, this exception is thrown java.lang.AssertionError: expectation "expectNext(1)" failed (expected: onNext(1); ...
M. Saidkhanov's user avatar
0 votes
0 answers
47 views

How to run tens of thousands concurrent transactions on PostgreSQL

Many of modern programming languages use lightweight threads (virtual threads/coroutines/goroutines) and thus scalability does not limited by number of threads anymore. But if these lightweight ...
Dmitrii Apanasevich's user avatar
0 votes
0 answers
67 views

r2dbc-pool: Using the r2dbc connection pool slows down the execution of parallel transactions

I am trying to optimize the reuse of PostgreSQL connections by implementing the r2dbc Connection Pool for jOOQ. But I noticed that transaction execution speed tends to be better whenever I use just a ...
Vlad M's user avatar
  • 1
0 votes
1 answer
103 views

How to test SELECT FOR UPDATE with R2DBC postgresql and Webflux

I have the following query in CoroutineCrudRepository, the database is postgresql of 14.8 version running in docker @Query("select * from test_table where status = 'NEW' order by creation_date ...
dippy tippy's user avatar
0 votes
0 answers
44 views

Using r2dbc-postgresql for CockroachDB result in authentication failure: "Password must not be null"

I'm trying to connect to a CockroachDB cluster using r2dbc-postgresql, (I've tried both org.postgresql as well as io.r2dbc) as well as spring-data-r2dbc from my reactive Kotlin app - which is running ...
Dongjun Lim's user avatar
0 votes
0 answers
77 views

Can't set the List<...> parameter in the query

I can't add the List<...> parameter, or rather ArrayList ($2). If I just put List<...> listId, I get the error: Cannot encode parameter of type java.util.ArrayList ([192, 193, 194, .... If ...
Арчи's user avatar
1 vote
0 answers
96 views

Spring r2dbc jOOQ transaction rollback not working

Transaction rollback does not seem to work when using r2dbc and jOOQ DemoRepository suspend fun insert(id: String) { if (id == "b") { throw RuntimeException("error while ...
memoryfoam's user avatar
0 votes
0 answers
21 views

What dialect should I use for r2dbc postgresql init.sql?

The problem is: I need to create a function. If I call it in Idea Postgre console - it works If I add it to init.sql - it fails with $$ tag create or replace function work(i integer) returns integer ...
user23066960's user avatar
0 votes
0 answers
44 views

What is the state of Kerberos support for R2DBC?

I am currently trying to figure out the support for general GSS Authentication but the R2DBC Postgres dependency claims there is no authentication handler for GSS Authentication. I am trying both ...
Lucas Ortiz's user avatar
0 votes
0 answers
66 views

spring transactional in R2DBC mongo and postgresql

I've started working with Spring Webflux and project reactor. I'm struggling with "Transactional" concept. I don't understand if @Transcational keyword is still valid on methods which ...
testyyy's user avatar
  • 23
0 votes
0 answers
150 views

How to map the row to the specific field in entity using R2DBC

How to map the row from the table to single field. Here is an example with book that holds the metadata in another class: // Simple pojo that contains the information about papers class PapersInfo { ...
Mercury's user avatar
0 votes
0 answers
101 views

Unable to register EnumCodec via Spring Boot R2DBC auto-config

I'm using spring-boot-starter-data-r2dbc 3.1.4 r2dbc-postgresql 1.0.2.RELEASE I've created TYPE MY_ENUM AS ENUM created MyEnumConverter extends org.springframework.data.r2dbc.convert....
Ngọc Hy's user avatar
  • 308
0 votes
0 answers
64 views

How I can get the last query statement executed on R2DBC to log with a WebFilter?

I have seen that inside the WebFilter (Using Spring Webflux) we have the access to the Application Context, so do you know the way to get the Last Query Executed? to log in my custom Logger. I know we ...
Alex Aceves's user avatar
1 vote
0 answers
105 views

Spring reactive db (r2dbc) insert data multithread issue

I'm trying to insert data in parallel ,using spring r2dbc, to psql table No matter how I run ,either in different connections or using the same connection and running in parallel batches/statements ...
shachar's user avatar
  • 553
0 votes
1 answer
131 views

How to write junit for r2dbc for postgres database?

I have a class which uses used R2dbcEntityTemplate as shown below r2dbcTemplate .getDatabaseClient() .sql("<Custom-Query>") .fetch() .all(); I am ...
girijanandan nucha's user avatar
0 votes
0 answers
71 views

Micronaut Data PostgresSql R2DBC Docker Image can't connect to a database

I have build application using micronaut r2dbc and postgresql r2dbc. I'm using AWS RDS for Database and I'm deploying docker image to AWS EKS and when I use AWS RDS credentials, I'm not able to ...
Chetan's user avatar
  • 94
0 votes
1 answer
484 views

Spring's R2DBC `DatabaseClient`: How to insert with `tstzrange` fields

Basically, in my WebFlux application, I have a Spring R2DBC's DatabaseClient, with which I am trying to insert into a table containing a row typed as tstzrange. When trying to insert a String into ...
Vincent C.'s user avatar
1 vote
1 answer
315 views

@Query is not working with r2dbc and postgres

@Repository public interface XYZRepository extends R2dbcRepository<XYZ, XYZPK> { @Query(value = "select * from xyz\n" + "right join (select max(capture_date) ...
crazy hoe's user avatar
0 votes
0 answers
77 views

r2dbc - How to find out the number of open connections via r2dbc-proxy?

I am testing the behavior of ConnectionFactory such as io.r2dbc.postgresql.PostgresqlConnectionFactory and io.r2dbc.pool.ConnectionPool There is a suspicion that PostgresqlConnectionFactory creates a ...
skipkolch's user avatar
1 vote
0 answers
247 views

R2DBC repositpries do not work even for basic methods

I'm using Spring Boot, java 17 and Postgresql in my reactive web application. However even simplest methods like cardRepository.findAll(); return ERROR c.a.a.c.h.ControllerExceptionHandler - ...
Sof's user avatar
  • 13
0 votes
0 answers
107 views

Wait for execution for R2DBC DatabaseClient

I am new at R2DBC , sorry for a basic question. My business scenario is that , I have one kafka consumer and after reading the data from a topic, I have to insert data in to a postgress table using ...
Sujoy's user avatar
  • 9
0 votes
2 answers
670 views

Testcontainers and r2dbc (password authentication failed for user "test")

I have a project that I would like to test using test container. However, when trying to initialize the database in the container, an error occurs Caused by: org.springframework.r2dbc.connection.init....
skyho's user avatar
  • 1,731
0 votes
1 answer
287 views

DB fields are not properly mapped to java objects when using reactive postgres r2dbc

I have a Spring Boot application with reactive stack (WebFlux). I work with PostgreSQL database using r2dbc driver. DB contains 2 records with all values present, but when I query I get empty fields. ...
stakeika's user avatar
  • 115
0 votes
0 answers
65 views

using postgesql DB with spring Boot application. app using r2dbc config to connect with DB. want to create jdbc config with r2dbc to connect same DB

r2dbc: url: r2dbc:postgresql://${DB.URL:}/${DB.NAME:}?currentSchema=${DB.SCHEMA.NAME:} username: ${DB.USERNAME:} password: ${DB.PASSWORD:} pool: enabled: true initial-size: 5 max-size: 100 jdbc-...
Sharafat Ali's user avatar
0 votes
1 answer
1k views

Validation query for R2DBC remains Idle when connection pool created using io.r2dbc.pool.ConnectionPoolConfiguration

I have a spring webflux application integrated with AWS Aurora Postgres. spring-boot-starter-webflux:2.6.6 spring-boot-starter-data-r2dbc:2.6.6 This brings in the below dependencies: io.r2dbc:r2dbc-...
Amol Kshirsagar's user avatar
0 votes
0 answers
47 views

R2dbc postgresql data loss issue

I have a reactive kafka consumer which read the data and saves the data into postgresql db using reactive drivers. Sometimes some data gets missed to save in the database , without any error . However,...
developer's user avatar
0 votes
0 answers
82 views

R2DBC SQL mapper conversion

I have two tables in my use case.. Project Task A project can have multiple task associated with that project. In task table I have FK relationship with project table, simple M:M relationship. As in ...
Sujoy's user avatar
  • 9
0 votes
1 answer
370 views

How to write testcase for DatabaseClient of r2dbc spring-boot library?

I am having the below class @Repository public class ItemRepository { @Autowired DatabaseClient databaseClient; @Autowired private Environment queries; protected String sql(...
Umang Kamdar's user avatar
0 votes
1 answer
557 views

How to handle null values for list using r2dbc ReactiveSortingRepository

I am using the R2DBC library with ReactiveSortingRepository and i am having the below query to fetch some data. @Query("SELECT DISTINCT item_id FROM item_table" + " WHERE ...
Umang Kamdar's user avatar
1 vote
0 answers
165 views

Spring webflux jooq setLocal not working with select

I am trying to set a local variable on Postgresql by using like below source code DSLContext @Bean(name = ["r2dbcDsl"]) fun r2dbcDsl(): DSLContext { return DSL.using(connectionFactory) } ...
mason's user avatar
  • 11
1 vote
0 answers
47 views

What "humane client library" r2dbc-postresql implementations exist?

I've come from Scala background using Akka streams and Slick to access DB. I'd like to introduce reactive programming to my current workplace, which is a Java shop. I've been looking at how to access ...
rojanu's user avatar
  • 1,612
2 votes
0 answers
788 views

R2DBC + spring : Failed to instantiate [io.r2dbc.pool.ConnectionPool]: Factory method 'connectionFactory' threw exception with message

When trying to initialize the application, I got an error. r2dbc + Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.r2dbc.pool.ConnectionPool]: Factory ...
skyho's user avatar
  • 1,731
0 votes
2 answers
619 views

Postgres r2dbc batch insert problems

I am trying to batch-persist a Flux-stream of articles into a Postgres r2dbc The application has two identical article tables (article_origin and article_destiny) The origin table has a million ...
artsgard's user avatar
2 votes
1 answer
633 views

Thread pool in r2dbc-postgresql

Can you help me understand? There is a Spring Boot (3.0.2) service with Spring Data R2DBC repository and r2dbc-postgresql driver. By default, a pool of 10 connections and 10 reactor-tcp-nio threads is ...
user18032014's user avatar
0 votes
0 answers
398 views

Interval to Duration coversion issue in Spring Boot

While using Reactive Relational Database Connectivity (R2DBC), I have written a method to convert Interval to Duration in Java, below is the implementation import io.r2dbc.postgresql.codec.Interval; ...
Aditya Tiwari's user avatar
3 votes
0 answers
938 views

R2DBC DatabaseClient parameter binding

I am unable to bind parameters to my query. The function looks like this: override fun findVenueById(id: Long): Mono<Venue> { val extended = query + "WHERE v.id = :id " return ...
Nina's user avatar
  • 63
0 votes
1 answer
242 views

How to map PostgreSQL 'infinity' value to LocalDateTime in Spring Data R2DBC?

How to map PostgreSQL 'infinity' value to LocalDateTime in Spring Data R2DBC? Java field, private LocalDateTime expireOn; In the database, it is auto-generated when there is no value or a null value ...
Thirumal's user avatar
  • 8,947
0 votes
1 answer
275 views

How to query jsonb datatype (Postgresql) in java code using Spring webflux & R2dbc

I have postgresql db with below structure CREATE TABLE products ( id bigserial, name varchar(30) NOT NULL, owner_id bigint, pdata jsonb NOT NULL, PRIMARY KEY (id) ); Here pdata is ...
Abdullah Imran's user avatar
2 votes
0 answers
473 views

TransientDataAccessResourceException - R2DBC pgdb connection remains in idle in transaction

I have a spring-boot application where using webflux and r2dbc-postgres. I have discovered a strange issue when trying to do some db operations in a flatMap(). Code example: @Transactional public Mono&...
Spiresix's user avatar
  • 141
1 vote
0 answers
317 views

Spring R2DBC Postgres Row Level Security

I'm trying to implement Postgres Row Level Security on my app that uses R2DBC. I found this AWS post that implements this but uses a non-reactive approach. I'm having problems converting this to a ...
kylie.zoltan's user avatar
2 votes
0 answers
154 views

How to gerenate custom id in spring data r2dbc?

When I have many entities and I want to use custom id generators (for example snowflake) with different sequences for each entity, should I write the corresponding generator in each entity or write ...
周晨阳's user avatar
2 votes
1 answer
550 views

Iam authentication with r2dbc-postgresql

For working with IAM authentication for a DB, a dynamic password is required to refresh the connection pool with new credentials. in r2dbc-postgresql I could not find any possibility of a custom ...
harsh's user avatar
  • 1,511
0 votes
1 answer
154 views

io.r2dbc.spi.R2dbcBadGrammarException: Duplicate column name "?column?"; SQL statement

I try to test my code with H2 DB. I've some migrations for all steps(init, schema, data). For running my migrations I use nkonev r2dbc-migrate When I try to run a test I catch an exception "SQL ...
hormunkul's user avatar
1 vote
2 answers
2k views

Insert Query using @Query in R2DBCRepository SpringWebFlux not Working

Seems Composite Key/@Embedded are not supported in R2DBC - link , I am trying to insert data using @Query annotation like below. @Repository("testRepository") public interface ...
lahirumw's user avatar
  • 183
4 votes
1 answer
923 views

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,...
mr.nothing's user avatar
  • 5,308
0 votes
2 answers
684 views

How to select the correct TransactionManager when using R2DBC together with Flyway and JDBC

Setup: micronaut 3.7.2 micronaut-data 3.8.1, micronaut-data-r2dbc, r2dbc-postgresql 0.9.2 Flyway 8.5.13, micronaut-jdbc-hikari, micronaut-flyway 5.4.1, postgresql 42.5.0 testcontainers (jdbc, r2dbc, ...
macmillancodes's user avatar
2 votes
1 answer
1k views

R2DBC Querying From Multiple Tables With Sorting and Pagination

I am trying to create endpoint using spring webflux. The result of endpoint to query from several tables, and most of values in where clause are optional. (example query is provided in the bottom). ...
Etibar - a tea bar's user avatar
1 vote
0 answers
465 views

Double nested entities in r2dbc for postgresql

I'm facing an issue when I'm trying to save an Expense onto the Postgresdb. When I try to save the entity I'm getting the following error, which dosen't say exactly what the problem is. java.lang....
brunomilitzer's user avatar
0 votes
0 answers
628 views

R2DBC-MSSQL how to connect to a database

I am trying to connect to my local SQL Server with R2DBC, unfortunately, I do not know where I am going wrong, I have a lot of experience with R2DBC, I use it all the time with other databases but ...
Alfa's user avatar
  • 115