spring-projects / spring-projects/spring-boot

Allow Data JDBC Dialect resolution without requiring DataSource initialization

Open
#47,781 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: blocked type: enhancement
Dominant language
Java
Stars
81.5k
Forks
42.7k
Avg merge
2d 4h
Merged PRs (30d)
65

Description

When obtaining a Dialect bean using Spring Data JDBC, the @Bean method depends on NamedParameterJdbcOperations leading to initialization of the entire bean graph including DataSource initialization even if the dialect is provided through properties (spring.data.jdbc.dialect=…). It would be good if access to NamedParameterJdbcOperations could be lazy.

The JDBC config itself isn't helpful in that regard as it declares NamedParameterJdbcOperations in its signature. Maybe an opportunity for improvement as well.

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 tracing the JDBC configuration and the @Bean method that resolves the Dialect, then inspect how its NamedParameterJdbcOperations parameter triggers DataSource initialization. Done means a dialect supplied by spring.data.jdbc.dialect can be obtained without initializing DataSource while the configuration remains functional; check or add focused tests around that startup path.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.