404 questions
-1
votes
1
answer
114
views
How exactly non-blocking database access work? [closed]
I am trying to understand how worker thread gets returned for other operations while there is still data-access query operation going on? How does it work in reactive libraries? For example- How does ...
1
vote
0
answers
86
views
Spring R2DBC save returns id null
I'm using R2DBC with R2dbcRepository in Spring Boot.
I have a table called Dispatches with Jakarta annotations but when I invoke the save() method on my repository the save method returns the same ...
1
vote
0
answers
103
views
R2dbc Mssql Login with service account principal
I'm working on a spring webflux app. I've been connecting to an Azure SQl database using username/password.
Now I want to switch to Active Directory Service principal, I now have a client id, a client ...
2
votes
0
answers
197
views
Resource Leak in R2DBC after spring boot upgrade
Since updating our project from Spring Boot 3.1.3 to Spring Boot 3.4.3, we have come across an unusual problem that we have not seen before.
We have a findAll() method that gets a Flux (of type Platz)....
1
vote
0
answers
409
views
Can I safely use both JDBC and R2DBC with Exposed in the same Kotlin application without transaction context conflicts?
I'm building a Kotlin server-side application using Ktor, JetBrains Exposed ORM, and coroutines. The app interacts with two databases:
SQLite (used as a local read-only reference DB)
PostgreSQL (used ...
0
votes
1
answer
126
views
Mapping R2DBC query result for a row with a column of array postgresql type
Stack: Kotlin 2.1.21, Spring Boot 3.5.3, Spring Data R2DBC 3.5.1
I got the folowwing code
enum class TimeTypesEnum {
FULL, PARTIAL;
companion object {
fun from(value: String): TimeTypesEnum =
...
0
votes
1
answer
71
views
Is Oracle Transparent Application Continuity also possible with r2dbc? [closed]
We have an API written in Kotlin that connects to an Oracle database with ojdbc(and JPA). High Availability is guaranteed via the Oracle Transparent Application Continuity settings.
The API uses ...
2
votes
1
answer
68
views
How do I add conditions that possibly do not exist
There are some tables like the following in our system: locations, addresses, cities.
The locations has a address_id that refers to addresses, and addresses has city_id that refers to cities.
...
0
votes
1
answer
87
views
repo.save() and repo.findById() does not work within the save reactive pipeline
I am trying a trivial test with a basic Spring Boot 3.4 application and the reactive MS Server driver r2dbc-mssql.
repo.save(User.builder().name("Joe Smoe").build())
.doOnNext(...
0
votes
0
answers
149
views
Spring r2dbc - SQL Server support version
I’m working on a Spring Boot WebFlux project and I’m planning to use R2DBC to interact with Microsoft SQL Server. However, I’m having difficulty finding clear information on which version of SQL ...
0
votes
1
answer
98
views
Select more aggregate roots in a single query using Spring Data R2DBC
I have an application in Spring Boot 3.4.x using Spring Data R2DBC.
Let's say I have two aggregate roots, Book and Author. I understand that from the reactive point of view, it is not possible to work ...
0
votes
1
answer
72
views
r2dbc throws 'url' attribute is not specified on graalVm native app
Does graalVm have issues with r2dbc working on postgres in Kotlin? I run the sample demo project from spring boot initializers (Kotlin, sping-boot 3.4.3, java 21), which has r2dbc dependency. When I ...
0
votes
0
answers
154
views
SpringData r2dbc vs jpa when saving a list of entities with the same ids
In Jpa Spring Data when using saveAll for entities with the same ids - saveAll successfully saves all the enitities into the database. For example
public interface JpaRepository extends JpaRepository&...
2
votes
1
answer
186
views
How to programmatically rollback transaction using Jooq Non blocking API?
It's not documented here https://www.jooq.org/doc/latest/manual/sql-execution/transaction-management/
It only shows you that an uncaught exception will cause a rollback.
The problem is that ...
2
votes
0
answers
134
views
Understanding N+1 Problem: Why does R2DBC handle JOINs differently than JPA?
I have a query that joins two tables (events and event_properties):
SELECT e.*, ep.*
FROM event e
JOIN event_properties ep
ON e.event_properties_id = ep.id
WHERE e.status = 0
In my R2DBC ...
0
votes
0
answers
168
views
Spring Boot r2dbc enum error - org.springframework.r2dbc.BadSqlGrammarException
I have been working on creating a chat_module application with Reactive programming - spring boot 3.4.1, postgres-r2dbc, and mongo reactive.
While previously I was using Strings for some columns in ...
1
vote
0
answers
309
views
R2dbcTimeoutException: Connection acquisition timed out despite sufficient MAX connections allocated
I am working on a Reactive Java Spring Boot application using R2DBC with MySQL. Below is the connection pool configuration I have set up:
spring.r2dbc.pool.enabled=true
spring.r2dbc.pool.initial-size=...
1
vote
1
answer
153
views
Execute procedures reactively using jooq
Im having trouble running JOOQ routines in a reactive way. My Spring project is set up with R2DBC, and the DSLContext bean uses its connection factory.
I have a database procedure that I want to ...
2
votes
1
answer
225
views
r2dbc with graalvm SPRING_R2DBC_URL not recognised
I would like to build a native image for an app which using R2DBC to access PostgreSQL.
Not sure why but with the following docker compose file the SPRING_R2DBC_URL is not recognised, I receive:
******...
1
vote
1
answer
223
views
@Trasactional annotation not working with webflux 3.3.2
We have recently started upgrading spring webflux version 2.7X to 3.3.2. After this upgrade, when we hit API with Postman it goes to controller layer and if service layer method is annotated with @...
0
votes
1
answer
445
views
R2dbc database not auto initialising in spring project
I am creating a simple spring boot project that connects to the r2dbc postgres
My application.yml looks like this :
r2dbc:
url: r2dbc:postgresql://localhost:5432/postgres
username: postgres
...
1
vote
1
answer
204
views
update the IAM password less authentication token before it get expired
My spring service is written in reactive way and because of that we are using r2dbc to establish database connection. Now I want to enable IAM password less authentication with AWS RDS.
@Bean
public ...
1
vote
0
answers
370
views
Locking rows in DB using R2DBC PostgreSQL and Webflux
I have an issue when trying to concurrently select rows in postgesql database using R2DBC driver.
I have method that should create entity with order number based on total quantity of these entites in ...
1
vote
3
answers
241
views
WebFlux + R2DBC: How to prevent a malicious REST client from DDoSing the app via slow response consumption
I am evaluating the Spring WebFlux + R2DBC stack for our next project. Consider this textbook code for REST response streaming:
@GetMapping("items")
public Flux<Item> findAll() {
...
0
votes
0
answers
56
views
How to implement an event based consumer which can process max n messages at any given time?
We have a scenario in the application where user uploads a file from UI.
The file along with some metadata is saved to DB.
Currently, we are running a scheduler which will poll the DB every 15 secs to ...
0
votes
1
answer
184
views
R2DBC MariaDB failover in Spring Boot 3
I want to perform a failover setup for r2dbc mariadb. We are using spring boot 3. I have read in some documents that from spring boot 3 it supports these behaviours.
I am expecting something like ...
0
votes
1
answer
66
views
R2DBC Save Operation Triggers Multiple Times
I am trying to create a Reactive API with simple CRUD operations that also sends messages out to Kafka. But for some reason, when using Mono and R2DBC save operations, it seems to trigger the save ...
0
votes
0
answers
436
views
How to connect to a R2DBC postgres schema
I have been having trouble connecting to R2DBC postgres schema. Just like we have a jdbc connection string which we use in Dbeaver or PgAdmin to visually see the tables and run query what is the ...
0
votes
1
answer
96
views
Micronaut R2DBC Parent Child Relationship Parent ID not getting inserted into child (One to Many)
I am new to R2DBC and I have a fairly standard parent child relationship Person / Address and when attempting to save a person object with an address both the person and the address get saved but the ...
0
votes
1
answer
115
views
Duplicate entries using Spring Batch and R2DBC
I'm new in the R2DBC environment and i'm afraid using it along Spring Batch to findAll the rows in a table with more than 8 million records can duplicate some rows in the process since R2DBC don't use ...
2
votes
0
answers
404
views
LEAK: ByteBuf.release() was not called before it's garbage-collected in spring webflux project
I keep getting leakbuffer error just by invoking my rest api, sometimes connection closed exception. I am not using any bytebuff exclusively in my code. I have rest api, on calling it should fetch ...
0
votes
1
answer
436
views
How to use relationships using R2DBC driver in springboot?
I have a project in spring boot 2.7 with java 11. Currently I am using JPA in spring boot to interact with DB. Since I use reactive library, I am thinking to upgrade to reactive drivers i.e. r2dbc. ...
0
votes
0
answers
55
views
AWS RDS DB Connection not restarting
In reactive spring boot service, use case is like we are trying to receive message from SQS and process it but we are observing that the db connections are getting closed once queue is empty and ...
0
votes
1
answer
332
views
Spring Data R2DBC: Saving Department with Empty Employee List (Unsupported array type)
I'm encountering an error while saving a Department object with Spring Data R2DBC. My Department model has an employees property that can hold a list of Employee objects. However, when I try to create ...
0
votes
1
answer
211
views
Spring R2DBC repository.save() not working inside flatMap()
Following is the function written in a service.
public Mono<BrandRest> createBrand(CreateBrandRequest request) {
record BrandCategoryRest(Brand brandRest, List<CategoryRest> ...
0
votes
1
answer
289
views
Pagination when entity has relations in Spring Data R2DBC
I have an entity
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "employees")
public class EmployeeEntity implements Persistable<String> {
@Id
@...
1
vote
0
answers
205
views
How to Escape Reserved Words in SQL Queries with R2DBC for SQL Server?
I'm working with a Spring Webflux application and using R2DBC to connect to a SQL Server database. I've encountered an issue when trying to perform a query that includes a reserved word as a column ...
-1
votes
1
answer
65
views
String refernce is held in heap after sql execution
Lately I have encountered a really strange memory leak.
I would appreciate if someone helps me resolve it.
public Mono<Boolean> insertOrders(List<ClientOrder> orders) {
if (orders....
1
vote
1
answer
70
views
jOOQ select Master-Details filter by details's property
Currently I am using the latest jOOQ 3.19.5(R2dbc/Postgres) in my project.
I encountered an issue like this.
Given master and details` table.
|master |
id,
type
|details|
id,
master_id,
other_id ...
0
votes
2
answers
703
views
How to process flux in batches and have each batch processed in parallel
There are 5,000,000 entities in my database. I am connecting to the database via a reactive driver (r2dbc). Next, I want to split it on 100,000 entities, split them into bundles of 1,000 entities and ...
1
vote
2
answers
366
views
POST with autogenerated id in r2dbc
I have spring boot/r2dbc application
My controller:
@PostMapping("/add")
public ResponseEntity<String> create(@RequestBody NotificationEntity e) {
notificationDAO.save(e).subscribe(...
0
votes
1
answer
521
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 ...
0
votes
1
answer
808
views
R2DBC - Is there a way to use two different database clients when using a CrudRepository?
Fairly new to Java, Spring and R2DBC.
I am using spring and R2DBC to create to database clients using the properties from my config.
I have a ReactiveCrudRepository that I want to use to make queries ...
0
votes
0
answers
96
views
R2DBC Core DatabaseClient.sql replacing column 'key' to '[*]key'
r2dbc.core.databaseclient.sql replace query that have column name 'key' to '[*]key' and this causes error in the query execution.
Mono<Map<String, Object>> first = db.sql("SELECT key ...
0
votes
1
answer
204
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 ...
0
votes
0
answers
190
views
Spring webflux - How to use rsql queries inside a spring reactive app using R2DBC?
I’m working on a reactive Java spring web app using webflux.
I’m trying to convert rsql queries received as a param within the endpoint URL.
I managed to get the details of this queries converted to ...
1
vote
1
answer
589
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 ...
0
votes
1
answer
107
views
Difference between Spring R2DBC using EntityCallbacks vs Mapping and use case?
I am trying to understand the difference between R2DBC EntityCallbacks and R2DBC Mapping. I am trying to use it in a Multitenant application, where I would like to map the TenantId using a web filter ...
0
votes
1
answer
516
views
Can I use Quarkus Reactive Panache with Oracle R2DBC? Are they compatible?
The Quarkus Oracle reactive extension is in tech preview for a long time for the RedHat supported build, so I'm looking for alternatives for prod use.
I'm using Mutiny and reactive rest and rest ...
0
votes
2
answers
2k
views
Spring r2dbc multiple insert statement execute one by one
I really don't understand what am i doing wrong because insert of 30000 rows takes about 20 minutes.
I also tried to insert 30000 with datagrip and it just takes like 1 second.
I am also thinking of ...