Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sql to Core 4.8.x #1545

Draft
wants to merge 9 commits into
base: 6.1.x
Choose a base branch
from
Draft

Sql to Core 4.8.x #1545

wants to merge 9 commits into from

Conversation

sdelamo
Copy link
Contributor

@sdelamo sdelamo commented Feb 17, 2025

No description provided.

@sdelamo sdelamo added the type: dependency-upgrade Upgrade a dependency label Feb 17, 2025
@radovanradic
Copy link
Contributor

radovanradic commented Feb 18, 2025

Looks like these tests are failing because of https://github.com/micronaut-projects/micronaut-sql/blob/6.1.x/jdbc/src/main/java/io/micronaut/jdbc/JdbcDataSourceEnabled.java added recently to support disabling datasources. Don't know if there was some improvement work in core 4.8.x, but looks like this condition is cached and only executed for one data source configuration although we have it declared here for each DatasourceConfiguration

@Context
    @EachBean(DatasourceConfiguration.class)
    @Requires(condition = JdbcDataSourceEnabled.class)
    public DataSource dataSource(DatasourceConfiguration datasourceConfiguration) {
        HikariUrlDataSource ds = new HikariUrlDataSource(datasourceConfiguration);
        addMeterRegistry(ds);
        dataSources.add(ds);
        return ds;
    }

Do we need different approach for requires condition now?

@dstepanov
Copy link
Contributor

There is a compilation issue

@sdelamo
Copy link
Contributor Author

sdelamo commented Feb 20, 2025

This test fails

./gradlew :micronaut-jdbc-hikari:test --tests "io.micronaut.configuration.jdbc.hikari.DatasourceConfigurationSpec"

@dstepanov can you check it?

@dstepanov
Copy link
Contributor

@radovanradic Where is it cached?

@radovanradic
Copy link
Contributor

I just asked if there were some changes in core, when I debugged this test I noticed @Requires(condition = JdbcDataSourceEnabled.class) is called only once with core 4.8.x and in 4.7.x it is called for each data source configuration.

@radovanradic
Copy link
Contributor

This was fixed using core 4.8.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: dependency-upgrade Upgrade a dependency
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants