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.
354
questions
0
votes
0
answers
9
views
R2dbc bind does not work with onErrorResume
I'm trying to save a record
public Mono<UUID> save(Post p) {
return databaseClient.sql("INSERT INTO posts (title, date, content) VALUES (:title, :date, :content)")
...
0
votes
0
answers
13
views
How to do batch saveAll with R2BDC
I am using R2DBC Springboot framework to perform my data extraction/insertion. I noticed that when i tried to perform the query below, it is not saving the records in parallel but sequentially. Saving ...
0
votes
0
answers
30
views
"Unsupported array type" while saving object with one to many relation
I have two entities User and UserAuthority with one to many relation like following
@Getter
@Setter
@Table(name = "users")
@Entity
public class User extends BaseEntity {
@OneToMany(...
0
votes
0
answers
13
views
Cannot read Postgis Geography data type in R2DBC
I am using PostGIS Geography type in my R2DBC Repository with custom Reader but even then I am getting this error.
Cannot decode value of type io.r2dbc.postgresql.codec.Point with OID 25281
This is ...
1
vote
1
answer
192
views
Using JOOQ DSLContext.transactionResult with setLocal
I am trying to set a local variable on Postgresql by using reactive way inside dslContext.transactionResult.
I want to keep the user_id, the id of the user who changed the product table, in the ...
0
votes
0
answers
6
views
R2DBC with WebFlux: notifications receiving stops silently
everyone.
So, I have a WebFlux application which uses a PostgreSQL database as a queue (LISTEN/NOTIFY). It works more or less fine; the problem is that at some point the DB notifications just stop ...
0
votes
0
answers
9
views
User springboot r2dbc to update eneity when exist and save on not exist
I just started to learn the idea of reactive programming, but I am a little confused now.
I have a table that records how many times each user completes each task, the table has a unique index using ...
0
votes
0
answers
33
views
How to use snowflakes in reactive applications or R2DBC support for snowflake?
To use postgres with reactive application, we can use -
api 'io.r2dbc:r2dbc-postgresql:0.8.10.RELEASE'
spring:
r2dbc:
url: r2dbc:postgresql://host:port/db
Is there similar R2DBC support for ...
0
votes
0
answers
22
views
Is there anyway to generate ID using R2DBC with Oracle?
I have a model
@Table("transactions")
data class Transaction(
@Id
val id: Long = 0,
var sender: String = "",
var receiver: String = "",
var currency: ...
-1
votes
0
answers
24
views
Writing to nested object database as Json with using a Converter on Spring boot r2dbc
This is my configuration
@Configuration
public class R2dbcConfig {
@Bean
public R2dbcCustomConversions r2dbcCustomConversions(Gson gson) {
List<Converter<?, ?>> converters =...
0
votes
1
answer
50
views
Spring ReactiveCrudRepository @Query with PostgreSql throws PostgresqlBadGrammarException: [42P01]
Given a ReactiveCrudRepository with specified @Query which passes unit test flawlessly using MariaDB backend but throws exception using PostgreSQL.
Other Spring repository queries succeeds (findById, ...
1
vote
1
answer
65
views
Difference between using JDBC and R2DBC connection for Jooq
The documentation for Reactive Fetching in Jooq mentions:
Out of the box, all jOOQ provided publishers will block on the underlying JDBC connection, but if you provide jOOQ with a io.r2dbc.spi....
0
votes
0
answers
24
views
How to make this r2dbc url?
Properties:
Name: app_port_poc
hostname: greshamdevdb01.global.trafigura.com
port: 1521
service name: greshamdev01.global.trafigura.com
My application in running in dev profile.
application-dev.yml:
...
2
votes
2
answers
25
views
Jooq & R2DBC execute DDL
I have my tables schema generated from the database, I'm trying to execute the ddl to create the tables using an r2dbc connection to an h2 in memory, but I cannot figure out what should I do.
The ...
0
votes
0
answers
29
views
r2dbcRepository vs r2dbcEntityTemplate performance
I have a Spring Reactive Project with Postgresql connection via spring.r2dbc
I am using an interface to persist data into the table.
import org.springframework.data.r2dbc.repository.R2dbcRepository;
@...
0
votes
1
answer
46
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 ...
0
votes
0
answers
27
views
R2DBC using Collection as parameter repository`s method for compare with uuid[]
DataBase: R2DBC Postgres
I have a column model_id at table with type: uuid[].
create table t_job
(
id uuid default gen_random_uuid() not null
primary key,
model_id ...
0
votes
1
answer
42
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 ...
0
votes
0
answers
48
views
how to configurate r2dbc with yaml?
I am configuring r2db-mysql application with yaml ,
but its run error when i try to connect mysql
here is my yaml config
spring:
r2dbc:
url: r2dbc:mysql://localhost:3306/schema?useUnicode=true&...
0
votes
1
answer
138
views
Error while testing with H2 database with Reactive Spring boot
I am using Reactive Spring boot to create a REST API and while the API works perfectly (I have tested it with postman), I also need to write some Unit tests and for the Unit tests I need to use a ...
0
votes
1
answer
206
views
Springboot Reactive findByusername return "monomap" by r2dbc
I am writing the reactive springboot with mysql and r2dbc.When i writing the query with findByUsername, it just return a String "monotype" instead of an object.
Code:
@Override
public ...
0
votes
0
answers
104
views
Failed to obtain R2DBC Connection with Oracle R2DBC driver
I try to connect to oracle db (v19) via oracle's r2dbc driver and spring data r2dbc but receive Failed to obtain R2DBC Connection error. Did not observe any item or terminal signal within 10000ms in '...
2
votes
1
answer
53
views
How to map left-joined tables to nested objects in JOOQ
I would like to left-join two tables and then map it into the following object where the metadata object should be null if no metadata was joined:
data class ObjectDto(
val objectId: String,
val ...
0
votes
2
answers
114
views
How to save java object in postgres jsonb column
Here is my code:
I need to save java object value as jsonb in database (r2dbc).
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Table("scoring")
public class ScoringModel ...
2
votes
1
answer
115
views
R2DBC MSSQL r2dbc.mssql.client.ReactorNettyClient : Connection has been closed by peer
I have started to work on a Spring WebFlux and R2DBC project. Mainly, my code works fine.
But after some elements I am receiving this warning
r2dbc.mssql.client.ReactorNettyClient : Connection has ...
0
votes
0
answers
52
views
Parallel requests within the same transaction
I would like to execute several SQL statements in parallel and within the same transaction in order to get work around a high latency to the database server (SQL Server).
From my research, it seems ...
1
vote
1
answer
201
views
Spring Boot, R2DBC, Querydsl, query with parameter - MssqlBadGrammarException
When I run query with parameter Param<LocalDateTime>, using directly SQLServer2012Templates everything works fine.
[DEBUG] [||] com.querydsl.sql.AbstractSQLQuery, shows generated query with '?', ...
1
vote
1
answer
218
views
How to map query result to List<Object> in R2DBC?
I am trying to migrate my JDBC based application to R2DBC, however I struggle with List based objects. How can I map the result from query to "List" field?
I was using ResultSetExtractor, ...
0
votes
0
answers
62
views
Kotlin WEB API MySQL r2dbc connection problem
I just trying to do some tests with Kotlin, I'm from .NET this is new territory. I've DBeaver installed on my machine and I can connect to the remote MySQL without issues.
I generate the project from ...
0
votes
1
answer
392
views
Can Spring R2DBC execute batch insert and update at the same time?
Can Spring R2BC save and update a batch at the same time?
I get a list of users (1 million rows from a file for example). Some of these users are new and I need to INSERT them to the table, and some ...
0
votes
0
answers
243
views
Transactions in R2BC for MYSQL using dev.miku
I was trying to implement simple transaction mechanism just to check how it works in reactive world using dev.miku for Mysql but getting below error
Receiver class dev.miku.r2dbc.mysql.MySqlConnection ...
0
votes
2
answers
111
views
Insert in DB for multiple records not working in webflux R2DBC
I am trying to insert some records in DB in one go, also tried for loop but it never happens, If I save a single record, it works
@RequiredArgsConstructor
@Service
public class UserServiceImpl {
...
0
votes
0
answers
99
views
How to create sub list in REST Reactive Spring
I am writing a test REST API application on Spring webFlux and R2DBC. The problem is that the list of articles, which is attached to the product can not be formed before sending it to the client.
...
0
votes
0
answers
227
views
R2dbc transactions not working properly when using coroutines
When using micronaut-data-r2dbc with coroutines the transaction context does not seems to propagate correctly all the times, causing a NoTransactionException.
@Transactional(Transactional.TxType....
0
votes
0
answers
86
views
Spring R2DBC set database session variable before every query execution
I have a Spring Boot application that uses R2DBC.
I need to run a bit of SQL to set a database session variable prior to each query execution.
This session variable controls row-level security at the ...
1
vote
0
answers
153
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 ...
0
votes
0
answers
85
views
Transaction not working while using Spring Boot, R2dbc and JOOQ
In service layer I have one method where I am doing mulitple DML operations across multiple tables using JOOQ DSLContext.
I have put @EnableTransactionManagement and using @Transational on my method ...
0
votes
0
answers
146
views
Apply liquibase changes in testcontainers (JOOQ)
I am trying to get rid of spinning up container instances before running integration tests. I would like to use test-containers for that. When migrating to a new approach I am not sure how to ...
0
votes
0
answers
107
views
DB2 R2DBC Driver
Is there any r2dbc driver for db2 ? I can't find anything on the internet, also the relevant IBM GIT page for r2dbc has been inactive for more than 2 years.
Thanks
0
votes
0
answers
17
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 ...
0
votes
0
answers
73
views
Why is Spring R2DBC Kotlin JPA adding dash and random characters when trying to map my data class fields?
This is for postgresql r2dbc coroutines etc.
I've got an Entity that looks like this:
@Table("entity_type")
data class EntityType(
@Id var id: UUID? = null,
val entityTypeName: Name,...
1
vote
1
answer
286
views
JOOQ integration with R2dbc driver for PostgreSQL
I am trying to setup correctly JOOQ with Spring Boot project which uses reactive stack based on r2dbc driver for Postgres DB. I came across quite few problems and at the very end "hopefully" ...
0
votes
0
answers
140
views
R2DBC PostgreSQL: reconnecting after DB restart
For some reason I can't use the connection pool. I create a connection manually:
private void createConnection() {
try {
connection = Mono.from(connectionFactory.create()).cast(...
0
votes
2
answers
306
views
R2DBC Postgres connection fails
My connection config:
@Configuration
@EnableR2dbcRepositories
public class DatabaseConfiguration extends AbstractR2dbcConfiguration {
@Bean
public PostgresqlConnectionFactory ...
0
votes
0
answers
195
views
Why Does R2DBC RowsUpdated() Return wrong count of updated rows?
I have an issue with R2DBC rowsUpdated(). I'm trying to update just one row in the database and get expect it to return 1 count to me for updated rows. But rowsUpdated() return 4 even if one row is ...
0
votes
1
answer
32
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 ...
0
votes
1
answer
296
views
r2dbc.BadSqlGrammarException: Table not found
I write an integraton test betwen EventRepository and a H2 database.
I use for these liquibase.
I'm trying to get data from a test H2 database, but I'm getting an error that it's empty.
If you do not ...
0
votes
0
answers
74
views
Spring Boot JPA Hibernate Search Optimisation
I'm developing a Spring Boot application right now. It's part of microservice architecture and implements a search using JPA Specifications. And then maps into DTO before returning to results. The ...
1
vote
2
answers
398
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 ...
0
votes
1
answer
449
views
How to correctly compose a query with r2dbc @Query for three value options: true, false, null ? (postgresql)
I'm trying to make a request to get data from the database
The boolean value of three options comes into the parameters:
false - show entities with false
true - show entity with true
null - any ...