kandi background
Explore Kits

r2dbc-pool | Connection Pooling for Reactive Relational Database | Database library

 by   r2dbc Java Version: v0.9.0.RELEASE License: Apache-2.0

 by   r2dbc Java Version: v0.9.0.RELEASE License: Apache-2.0

Download this library from

kandi X-RAY | r2dbc-pool Summary

r2dbc-pool is a Java library typically used in Database applications. r2dbc-pool has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub, Maven.
Connection Pooling for Reactive Relational Database Connectivity
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • r2dbc-pool has a low active ecosystem.
  • It has 204 star(s) with 30 fork(s). There are 15 watchers for this library.
  • There were 3 major release(s) in the last 12 months.
  • There are 7 open issues and 120 have been closed. On average issues are closed in 44 days. There are 1 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of r2dbc-pool is v0.9.0.RELEASE
r2dbc-pool Support
Best in #Database
Average in #Database
r2dbc-pool Support
Best in #Database
Average in #Database

quality kandi Quality

  • r2dbc-pool has 0 bugs and 0 code smells.
r2dbc-pool Quality
Best in #Database
Average in #Database
r2dbc-pool Quality
Best in #Database
Average in #Database

securitySecurity

  • r2dbc-pool has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • r2dbc-pool code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
r2dbc-pool Security
Best in #Database
Average in #Database
r2dbc-pool Security
Best in #Database
Average in #Database

license License

  • r2dbc-pool is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
r2dbc-pool License
Best in #Database
Average in #Database
r2dbc-pool License
Best in #Database
Average in #Database

buildReuse

  • r2dbc-pool releases are available to install and integrate.
  • Deployable package is available in Maven.
  • Build file is available. You can build the component from source.
  • Installation instructions, examples and code snippets are available.
  • It has 3316 lines of code, 265 functions and 26 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
r2dbc-pool Reuse
Best in #Database
Average in #Database
r2dbc-pool Reuse
Best in #Database
Average in #Database
Top functions reviewed by kandi - BETA

kandi has reviewed r2dbc-pool and discovered the below as its top functions. This is intended to give you an instant insight into r2dbc-pool implemented functionality, and help decide if they suit your requirements.

  • Creates a connection pool .
  • Starts the downloader .
  • Builds a connection pool configuration .
  • Disposes this connection pool .
  • Converts value to integer .
  • Converts value to boolean .
  • Downloads a file from an URL .
  • Determine if this connection factory supports .
  • Assert that the given object is not null .
  • Sets the autoCommit flag .

r2dbc-pool Key Features

Connection Pooling for Reactive Relational Database Connectivity

Getting Started

copy iconCopydownload iconDownload
// Creates a ConnectionPool wrapping an underlying ConnectionFactory 
ConnectionFactory pooledConnectionFactory = ConnectionFactories.get("r2dbc:pool:<my-driver>://<host>:<port>/<database>[?maxIdleTime=PT60S[&…]");

Publisher<?extends Connection> connectionPublisher = pooledConnectionFactory.create();

Maven configuration

copy iconCopydownload iconDownload
<dependency>
  <groupId>io.r2dbc</groupId>
  <artifactId>r2dbc-pool</artifactId>
  <version>${version}</version>
</dependency>

Building from Source

copy iconCopydownload iconDownload
 $ ./mvnw clean install

Community Discussions

Trending Discussions on r2dbc-pool
  • How to enable connection pooling with spring-boot-starter-data-r2dbc?
Trending Discussions on r2dbc-pool

QUESTION

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

Asked 2020-Dec-16 at 09:20

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 notation):

  • org.springframework.boot:spring-boot-starter-data-r2dbc:2.3.5.RELEASE
  • io.r2dbc:r2dbc-postgresql

I need to enable connection pooling for R2DBC connections. Unfortunately, I could not find any exhaustive manual to do so.

According to this quite outdated release notes I have to add also io.r2dbc:r2dbc-pool and use spring.r2dbc.pool.* properties to configure pooling.

Also, according to this reference I do not need to turn on pooling manually because SB will enable it if r2dbc-pool is found on the classpath.

Is it enough or do I miss something?

ANSWER

Answered 2020-Dec-16 at 09:20

Answering my own question.

TLDR

  • Having org.springframework.boot:spring-boot-starter-data-r2dbc:2.3.5.RELEASE is enough to have connection pooling enabled by default
  • No need to add io.r2dbc:r2dbc-postgresql explicitly
  • No need to put :pool: in the URL in this case

Some detailed findings. it seems there are two ways to enable connection pool:

  1. Put :pool: driver chunk into the URL and then io.r2dbc.pool.PoolingConnectionFactoryProvider#create will take care of creating a Connection Pool. This is described at https://github.com/r2dbc/r2dbc-pool#getting-started
  2. Do not have spring.r2dbc.pool.enabled=false in configs (meaning that its absence is interpreted as true by default). This way a Connection Pool will be created by the org.springframework.boot.autoconfigure.r2dbc.ConnectionFactoryConfigurations.Pool#connectionFactory. I am not sure, but it looks like a generalized Spring Boot configuration-style override over a library specific :pool: option.

This options are independent and partly overlap and the second one takes precedence.

The second component evaluates also presence of the :pool: in the URL (see org.springframework.boot.autoconfigure.r2dbc.ConnectionFactoryConfigurations.PooledConnectionFactoryCondition) and if found it delegates the creation of the Connection Pool to the first one.

There is also a peculiar conclusion - having explicit spring.r2dbc.pool.enabled=false leads to creation of a Connection Pool anyway if there is a :pool: in the URL. Therefore the only way to disable pooling is to have spring.r2dbc.pool.enabled=false and to omit :pool: in the URL at the same time.

Source https://stackoverflow.com/questions/65303082

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install r2dbc-pool

Configuration of the ConnectionPool can be accomplished in several ways:. The delegated DRIVER (via PROTOCOL) above refers to the r2dbc-driver, such as h2, postgresql, mssql, mysql, spanner. All other properties are driver-specific. The R2DBC specification defines as of version 0.9 lifecycle support for connections (Lifecycle.postAllocate, Lifecycle.preRelease). R2DBC Pool integrates with connections that implement lifecycle methods by inspecting the actual connection. postAllocate is called after allocating a connection and before returning it to the caller. preRelease is called upon Connection.close(), right before returning the connection into the pool. Any error signals in postAllocate are propagated to the allocation subscriber. Error signals of preRelease are logged and suppressed. In both cases, error signals lead to immediate invalidation of the connection. Additionally, the pool accepts custom postAllocate and preRelease functions through the builder to prepare the connection or to cleanup the connection before returning it into the pool. Custom lifecycle methods are called within the Lifecycle closure to ensure the connection-side lifecycle.

Support

Having trouble with R2DBC? We'd love to help!.

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Compare Database Libraries with Highest Support
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.