Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • May 19 14:55
    harmvanderwal commented #500
  • May 19 09:40
    mp911de milestoned #500
  • May 19 09:40
    mp911de commented #500
  • May 19 09:13
    harmvanderwal commented #500
  • May 19 08:10
    harishvashistha commented #474
  • May 18 11:44
    mar-v-in commented #511
  • May 18 11:24
    mp911de demilestoned #511
  • May 18 11:24
    mp911de milestoned #511
  • May 18 11:24
    mp911de commented #511
  • May 18 11:24

    mp911de on 0.8.x

    Improve codec caching. Codecs … (compare)

  • May 18 10:44
    mar-v-in commented #511
  • May 17 15:12
    liuzzzz commented #119
  • May 17 15:04
    liuzzzz commented #119
  • May 17 09:21
    mp911de labeled #392
  • May 17 09:21
    mp911de commented #392
  • May 17 09:20
    mp911de commented #392
  • May 17 09:20
    mp911de commented #511
  • May 17 09:18
    mp911de closed #511
  • May 17 09:18

    mp911de on main

    Improve codec caching. Codecs … (compare)

  • May 17 09:18

    mp911de on 0.9.x

    Improve codec caching. Codecs … (compare)

Christoph Sturm
@christophsturm
in the h2 client why does Statement.bind(string, value) set bindings.open to false, and Statement.bind(int, value) does not? https://github.com/r2dbc/r2dbc-h2/blob/main/src/main/java/io/r2dbc/h2/H2Statement.java#L75
2 replies
danu
@FutureGadget
io.r2dbc.spi.R2dbcTimeoutException: Connection Acquisition timed out after 2000ms
j.l.IllegalArgumentException: Too many permits returned: returned=1, would bring to 11/10\n\tat r.p.AllocationStrategies$SizeBasedAllocationStrategy.returnPermits(AllocationStrategies.java:141)\n\tat r.pool.AbstractPool.destroyPoolable(AbstractPool.java:158)\n\tat r.p.SimpleDequePool.evictInBackground(SimpleDequePool.java:152)\n\tat o.s.c.s.i.r.ReactorSleuth.lambda$null$6(ReactorSleuth.java:309)\n\tat r.c.s.SchedulerTask.call(SchedulerTask.java:68)\n\tat r.c.s.SchedulerTask.call(SchedulerTask.java:28)\n\tat j.u.c.FutureTask.run(FutureTask.java:264)\n\tat j.u.c.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)\n\tat s.a.w.async.WrTask.run(WrTask.java:35)\n\tat j.u.c.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat j.u.c.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.lang.Thread.run(Thread.java:834)\n
The message below is our failed health check request due to an error occured above.
I am using spring data r2dbc with miku mysql driver and I sometimes got this error..
Does anyone have a clue?
Thank you in advance.
{
  "timestamp": "2022-01-16T13:50:48.376+09:00",
  "level": "ERROR",
  "thread_name": "reactor-tcp-epoll-3",
  "logger_name": "reactor.core.publisher.Operators",
  "throwable_class": "java.lang.IllegalStateException",
  "throwable_root_cause_class": "java.lang.IllegalStateException",
  "message": "Operator called default onErrorDropped",
  "caller_class_name": "reactor.util.Loggers$Slf4JLogger",
  "caller_method_name": "error",
  "caller_file_name": "Loggers.java",
  "caller_line_number": 314,
  "stack_trace": "<#8a783798> j.l.IllegalStateException: Request queue was disposed\n\tat d.m.r.m.c.RequestQueue.requireDisposed(RequestQueue.java:150)\n\tat d.m.r.m.c.RequestQueue.dispose(RequestQueue.java:139)\n\tat d.m.r.m.c.ReactorNettyClient.drainError(ReactorNettyClient.java:253)\n\tat d.m.r.m.c.ReactorNettyClient.resumeError(ReactorNettyClient.java:214)\n\tat r.c.p.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:94)\n\tat o.s.c.s.i.r.ScopePassingSpanSubscriber.onError(ScopePassingSpanSubscriber.java:95)\n\tat r.c.p.FluxConcatMap$ConcatMapImmediate.innerError(FluxConcatMap.java:308)\n\tat r.c.p.FluxConcatMap$ConcatMapInner.onError(FluxConcatMap.java:872)\n\tat o.s.c.s.i.r.ScopePassingSpanSubscriber.onError(ScopePassingSpanSubscriber.java:95)\n\tat r.c.p.Operators.error(Operators.java:197)\n\tat r.c.p.MonoError.subscribe(MonoError.java:52)\n\tat r.c.p.InternalMonoOperator.subscribe(InternalMonoOperator.java:64)\n\tat o.s.c.s.i.r.SleuthMonoLift.subscribe(ReactorHooksHelper.java:225)\n\tat r.c.publisher.Mono.subscribe(Mono.java:4...\n",
  "type": "service",
  "pid": 31117,
  "hostname": "DSV-NUGUP-CALENDAR-STG01",
  "requested_uri": "/health",
  "traceId": "8cc488d24f89a01e",
  "spanId": "8cc488d24f89a01e",
  "method": "GET"
}
r2dbc/r2dbc-pool#92
It seems like a reactor-pool bug, I guess..
Giovanni De Stefano
@zxxz

Hello, I am using r2dbc-mssql and I am struggling with an error I get after a SELECT:

2022-01-24 14:38:08.907 ERROR 1 --- [tor-tcp-epoll-3] i.r2dbc.mssql.client.ReactorNettyClient  : Error: java.lang.IllegalArgumentException: Invalid header type: 0x0
 java.lang.RuntimeException: java.lang.IllegalArgumentException: Invalid header type: 0x0
     at io.r2dbc.mssql.client.StreamDecoder$ListSink.error(StreamDecoder.java:350) ~[r2dbc-mssql-0.8.7.RELEASE.jar:0.8.7.RELEASE]
     Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
 Assembly trace from producer [reactor.core.publisher.FluxFlattenIterable] :
     reactor.core.publisher.Flux.concatMapIterable
     io.r2dbc.mssql.client.ReactorNettyClient.<init>(ReactorNettyClient.java:250)
 Error has been observed at the following site(s):
     *__Flux.concatMapIterable ⇢ at io.r2dbc.mssql.client.ReactorNettyClient.<init>(ReactorNettyClient.java:250)
 Original Stack Trace:
         at io.r2dbc.mssql.client.StreamDecoder$ListSink.error(StreamDecoder.java:350) ~[r2dbc-mssql-0.8.7.RELEASE.jar:0.8.7.RELEASE]
         at io.r2dbc.mssql.client.StreamDecoder.withState(StreamDecoder.java:135) ~[r2dbc-mssql-0.8.7.RELEASE.jar:0.8.7.RELEASE]
         at io.r2dbc.mssql.client.StreamDecoder.decode(StreamDecoder.java:88) ~[r2dbc-mssql-0.8.7.RELEASE.jar:0.8.7.RELEASE]
         at io.r2dbc.mssql.client.StreamDecoder.decode(StreamDecoder.java:64) ~[r2dbc-mssql-0.8.7.RELEASE.jar:0.8.7.RELEASE]
         at io.r2dbc.mssql.client.ReactorNettyClient.lambda$new$6(ReactorNettyClient.java:255) ~[r2dbc-mssql-0.8.7.RELEASE.jar:0.8.7.RELEASE]

 [...]


Caused by: java.lang.IllegalArgumentException: Invalid header type: 0x0
    at io.r2dbc.mssql.message.header.Type.valueOf(Type.java:68) ~[r2dbc-mssql-0.8.7.RELEASE.jar:0.8.7.RELEASE]
    at io.r2dbc.mssql.message.header.Header.decode(Header.java:215) ~[r2dbc-mssql-0.8.7.RELEASE.jar:0.8.7.RELEASE]
    at io.r2dbc.mssql.client.StreamDecoder$DecoderState.readChunk(StreamDecoder.java:289) ~[r2dbc-mssql-0.8.7.RELEASE.jar:0.8.7.RELEASE]
    at io.r2dbc.mssql.client.StreamDecoder.withState(StreamDecoder.java:112) ~[r2dbc-mssql-0.8.7.RELEASE.jar:0.8.7.RELEASE]
    at io.r2dbc.mssql.client.StreamDecoder.decode(StreamDecoder.java:88) ~[r2dbc-mssql-0.8.7.RELEASE.jar:0.8.7.RELEASE]
    at io.r2dbc.mssql.client.StreamDecoder.decode(StreamDecoder.java:64) ~[r2dbc-mssql-0.8.7.RELEASE.jar:0.8.7.RELEASE]
    at io.r2dbc.mssql.client.ReactorNettyClient.lambda$new$6(ReactorNettyClient.java:255) ~[r2dbc-mssql-0.8.7.RELEASE.jar:0.8.7.RELEASE]
    at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.drainAsync(FluxFlattenIterable.java:351) ~[reactor-core-3.4.13.jar:3.4.13]
    at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.drain(FluxFlattenIterable.java:686) ~[reactor-core-3.4.13.jar:3.4.13]
    at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.request(FluxFlattenIterable.java:274) ~[reactor-core-3.4.13.jar:3.4.13]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.request(FluxOnAssembly.java:649) ~[reactor-core-3.4.13.jar:3.4.13]

How should I interpret this llegalArgumentException: Invalid header type: 0x0/0x32/0x61 ...?

Any pointer would be much appreciated! Thanks!

menakaprabu
@menakaprabu
Hi team
I am using r2dbc-pool (0.8.8.RELEASE) where I am getting Connection unexpectedly closed exception for every 30 mins from boot time. It is not happening without using pool. I am using mssql protocol. Please suggest, what I am missing here.
Sai Dinesh
@SaiDinesh1017
Hi Team, Is there a way that we can Cache DNS lookup while making calls to Database using r2dbc?
Robert Feng
@sfeng96
Hi all, any r2dbc connector has built-in support for IAM auth and failover for RDS Aurora?
Toshihiro Nakamura
@nakamura-to

Hello, the README of oracle-r2dbc says the following.

Oracle R2DBC's ConnectionFactory and ConnectionFactoryProvider are thread safe. All other SPI implementations are not thread safe.

Is this true?

Manish Jain
@manishjain5238
Hi All, As per readme of https://github.com/pgjdbc/r2dbc-postgresql, it says "Read and write support for all data types except LOB types (e.g. BLOB, CLOB)". Do anyone know when support for Blob is coming in postgresql r2dbc or is there any alternative mechanism to support them?
Mark Paluch
@mp911de
That's a documentation mistake for the Postgres driver. Blob and Clob types are supported. Can you either submit a pull request or file a bug report, @manishjain5238 ?
Manish Jain
@manishjain5238
Sure, Thanks @mp911de
Manish Jain
@manishjain5238
Ravi
@kashaRavi_twitter
Hello,
Im trying to use r2dbc testcontainer for writing integration tests and getting the below error.
org.springframework.boot.autoconfigure.r2dbc.ConnectionFactoryOptionsInitializer$ConnectionFactoryBeanCreationException: Failed to determine a suitable R2DBC Connection URL
My r2dbc url looks like r2dbc:tc:postgresql://localhost:5432/guardrails_service?TC_IMAGE_TAG=10.11
pd-gov
@pd-gov
Hey, I have a Data source that is a Flux<DataBuffer> that I want to insert into a column without first buffering the entire content. Is this possible with R2DBC?
Mark Paluch
@mp911de
Only with SQL Server. For every other database, the INSERT is encapsulated within a single frame which requires accumulation (buffering) of the content.
srbk
@srbk:matrix.org
[m]
I am looking for help to see some example around R2DBC Stored Procedure
DB - Oracle.. I didn't find much content around Stored Procedure. If anybody can point me to the right direction
jurek7
@jurek7
Hello, I'm using Spring Webflux and Spring Data R2DBC with PostgreSQL database and during performance tests we noticed some long running queries(~1 hour) under high load which are of course application issue but I wonder if there is any mechanism to set some kind of query execution timeout. Thx for any help
4 replies
jurek7
@jurek7
image.png
Frazer Joe Dourado
@douradofrazer

Hey everyone, I'm using Spring Webflux and Spring Data R2DBC with PostgreSQL. I'm facing a weird issue where the subscription does not complete on an error thrown by R2dbc

Error: SEVERITY_LOCALIZED=ERROR, SEVERITY_NON_LOCALIZED=ERROR, CODE=23503, MESSAGE=insert or update on table "dummy" violates foreign key constraint "eq_fkey", DETAIL=Key (iso_code)=(111) is not present in table ""., SCHEMA_NAME=, TABLE_NAME=, CONSTRAINT_NAME=, FILE=ri_triggers.c, LINE=3255, ROUTINE=ri_ReportViolation

Any idea how this can be caught ?

9 replies
Karim
@karim789
Why can't we mix r2dbc and jdbc in the same application ?
7 replies
Karim
@karim789
So I gave up and did a under the hood JDBC datasource.
Knut Schleßelmann
@kschlesselmann
Hi. Right now we try to run a service on azure (mariadb) and after some random time (it seems when the service is inactive) the next couple requests always result in Failed to obtain R2DBC Connection; nested exception is io.r2dbc.spi.R2dbcNonTransientResourceException: Connection is close. Cannot send anythinganyone an idea what's going on here?
9 replies
Hantsy Bai
@hantsy
Hi, I have a question about the custom type of R2dbc, such as we want to use JavaMoney in projects, but how to use it in a R2dbc query without Spring Data R2dbc custom converisons
For example, how to map a Java Money monetaryamout (combines amout and currency) with a R2dbc table column? And it is possile to map it to two columns (amout and currency) respectively?
1 reply
ColinZou
@ColinZou

Hi, I got null id after called repository.save. Anyone knows what was going on?

  1. I am having a table like this:
    @Table
    @Entity
    data class AuthDomainModel(@Id @GeneratedValue var id: Int? = null,
                            var modelName:String)
  2. And a repository like this

    interface AuthDomainModelRepository : ReactiveCrudRepository<AuthDomainModel, Int>
  3. Got id=null after saving, tried two methods

    var entity = AuthDomainModel(modelName = name)
        return transactionalOperator
            .transactional(domainModelRepository.save(entity))
            .map { item ->
              // CHECK HERE item.id is null  WTF??
                mapper.fromEntity(item)
            }
    return domainModelRepository
            .save(entity)
            .map { item ->
               // item.id is NULL too
                mapper.fromEntity(item)
           }
5 replies
Arun Kumar Balasubramani
@arunkumarpro_gitlab

Hi, I am using r2dbc-postgresql:0.9.0 from Kotlin and getting the following error while mapping an integer column value of a Postgres table row. Does anyone have any info on why this error could happen?

Error:

 java.lang.IllegalArgumentException: Cannot decode value of type int with OID 23
    at io.r2dbc.postgresql.codec.DefaultCodecs.decode(DefaultCodecs.java:222)
    at io.r2dbc.postgresql.PostgresqlRow.decode(PostgresqlRow.java:104)
    at io.r2dbc.postgresql.PostgresqlRow.get(PostgresqlRow.java:85)
    at com.doordash.runtime.web.repositories.experiments.AnalysisMetricsRepository.MAPPING_FUNCTION$lambda-4(AnalysisMetricsRepository.kt:111)
    at org.springframework.r2dbc.core.DatabaseClient$GenericExecuteSpec.lambda$map$1(DatabaseClient.java:222)
    at io.r2dbc.postgresql.PostgresqlResult.lambda$map$2(PostgresqlResult.java:123)

Code:

    suspend fun getEntities(id: UUID): List<Entity> {
        return template.databaseClient.sql("Select entity.*, child.name from table entity inner join child_table child on entity.c_id = child.id where entity.id = :id")
            .bind("id", id)
            .map(MAPPING_FUNCTION)
            .all()
            .asFlow()
            .toList()
    }

private val MAPPING_FUNCTION: Function<Row, Entity> = Function { row ->
            Entity(
               ...
                intColumn = row.get("integer_column_name", Int::class.java)
            )
        }
2 replies
jayground8
@jayground8

Hello, I hope here is right place to ask my question about R2DBC driver in general.

r2dbc-postgesql and r2dbc-mysql utilize "reactor-netty". As far as I understand, It uses tcp client of reactor netty and It relies on TCP flow control for backpressure mechanism. (I tried to understand how it works from the source codes) this is how I understood

If i make a select query to database, database will fetch a resultSet and send all items to a client(reactor-netty tcp client). Even though a client requests only n number of items to a publisher(database), a client actually can't control how much data a publisher(database) send. Just packets are buffered in socket receive buffer first. When reactor-netty reads it from Channel, It stores data to a queue. later subscribers(consumers) get items as much as they requests through reactive stream "reqeust(n)" from queue, not purely from database.

database can send specific number of row items to client with fetch size option in case of postgresql, but It doesn't mean database understand how much data a consumer wants through reactive stream mechanism.

I wonder if I misunderstood its limitation. (if I understood correctly) I am also curious if there is anything under development to solve this limitation. (to fetch data from database through R2DBC with understanding consumer's requests purely).

Thank you

Mark Paluch
@mp911de

It uses tcp client of reactor netty and It relies on TCP flow control for backpressure mechanism

Mostly, but not only. When using cursored execution and configuring a fetch size, chunks of the cursor are read only if the previous chunk has been emitted. So cursors help with propagating backpressure to the server in some sense.

Does that help @jayground8 ?
jayground8
@jayground8
@mp911de Thank you for reply. I could see that there is an option to set up a fetch size, but I don't see any code setting the fetch size dynamically based on a consumer's request n in r2dbc-postgresql.
AishwwaryaMr
@AishwwaryaMr
Hi all, any updates on mybatis-r2dbc? is there a possibility of mybatis supporting r2dbc in the near future?
Aviram Birenbaum
@abiren
Hi, I am new to r2dbc, and just getting into it. I managed to access the table but I have a conversion exception ("No converter found capable of converting from type [java.lang.Integer] to type [java.lang.Boolean]") because in the database it is defined as INT(1) and boolean in the entity. Is there a way to add a custom conversion for the column? something like org.springframework.core.convert.converter.Converter?
Mark Paluch
@mp911de
That sounds like a #spring-data issue
1 reply
Ricardo Gaspar
@rjbgaspar
Hello,
I getting com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". since I upgrade com.microsoft.sqlserver:mssql-jdbc version from "9.4.1.jre8" to "10.2.0.jr8"
I tried to set SPRING_R2DBC_PROPERTIES_SSL=false (should not be needed according to documentation) but the error still persist.
Any ideas in how to overcome this (I do not need to use SSL).
Tanks in advance
2 replies
Aviram Birenbaum
@abiren
@mp911de I am trying to configure the r2dbc to use credentials I am taking from a vault. I see that this code is never called, and the default configuration based on the application.properties is loaded. How I configure my values?
@Configuration
class MySqlR2dbcConfiguration: AbstractR2dbcConfiguration() {

    @Bean
    override fun connectionFactory(): ConnectionFactory {
            val connOpt = ConnectionFactoryOptions.parse(url).mutate()
                .option(USER, "vault-username")
                .option(PASSWORD, "vault-password")
                .build()
            return ConnectionFactories.get(connOpt)
    }
}
1 reply
Jon Harper
@jonenst
Hi, I'm using r2dbc-pool and would like to dump the pool configuration to stdout when it's initialized. I couldn't find an existing logger that I can enable to achieve this. Does anyone have an idea about this ? As a comparision, for HikariCP, is use com.zaxxer.hikari.HikariConfig (random example from the internet: https://programmer.group/using-hikaricp-in-spring-mvc-project.html )
Mark Paluch
@mp911de
There's no such thing for the pool. However, ConnectionPool has access to a logger so that it would be pretty simple to add such a feature. Care to file a feature request at https://github.com/r2dbc/r2dbc-pool?
Jon Harper
@jonenst
Sure, thank you for your time !
Jon Harper
@jonenst
Srepfler Srdan
@schrepfler
Hi, can someone point me to any experiences or lessons from using r2dbc-postgresql with things like pg-bouncer?
do I need to disable connection pooling on the application alltogether, do I need to size it differently, what's the general recommended approach?
harish vashist
@harishvashistha1:matrix.org
[m]
@mp911de: can you please suggest if r2dbc driver supports connection fail over capabilities e.g. can we specify list of postgres hosts in connection URL? so that application can connect to any postgres host which is available at that time in our db cluster. Postgres JDBC driver has this capability already available. Does r2dbc support this with some extra options available with JDBC connection failover feature?
harish vashist
@harishvashistha1:matrix.org
[m]
@mp911de: any response, if you are aware for above question?
Mark Paluch
@mp911de
Right now, the Postgres driver doesn't support failover. It is mostly due to the fact that I hadn't had any time to follow up with the failover strategy to complete the pull request
harish vashist
@harishvashistha1:matrix.org
[m]
@mp911de: thanks for the response, we would really appreciate if you would be able to proceed and merge the changes which are available in PR 474 I can see developer claimed this PR has the required fixes for the db fail-over capabilities of prostgres driver r2dbc
aditya parikh
@adityaparikh_twitter
When using r2dbc postgres or for that matter any driver, we can have as many non blocking threads but would the upper bound be limited to the max connection pool size?
Mark Paluch
@mp911de
The upper bound of threads should not exceed your number of CPU cores where the app runs on, otherwise you generate context switching overhead.
It's different from synchronous connection pool sizing