spring-projects / spring-projects/spring-framework

Add support for lazy connections in R2DBC in the same manner as LazyConnectionDataSourceProxy

Open
#33,897 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: data type: enhancement
Dominant language
Java
Stars
60.2k
Forks
38.8k
Avg merge
5d 2h
Merged PRs (30d)
27

Description

Support lazy connections in R2DBC following the same concepts in LazyConnectionDataSourceProxy for JDBC.

atm hitting an "empty" transaction (the calls are cached so no actual database operations are performed) still borrows a connection from the pool, starts the connection and commits the transaction.

2024-11-15T14:15:16.436-08:00 DEBUG 8774 [atcher-worker-9] io.r2dbc.mssql.QUERY                     : Executing query: SELECT 1
2024-11-15T14:15:16.447-08:00 DEBUG 8774 [actor-tcp-nio-5] io.r2dbc.mssql.QUERY                     : Executing query: BEGIN TRANSACTION ****;
2024-11-15T14:15:16.449-08:00 DEBUG 8774 [actor-tcp-nio-5] io.r2dbc.mssql.QUERY                     : Executing query: IF @@TRANCOUNT > 0 COMMIT TRANSACTION;

(the SELECT 1 is the connection pool validation query)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing R2DBC connection and transaction handling with the JDBC LazyConnectionDataSourceProxy concepts named in the issue. Verify that an empty transaction avoids borrowing, starting, and committing a database connection, including the pool validation-query behavior shown in the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.