Skip to content

quarkus-spring-data-jpa extension always loads import.sql, even in prod mode #50792

@holly-cummins

Description

@holly-cummins

Describe the bug

This is long-standing behaviour (at least as far back as 3.10). When using the Spring Data compatibility extensions, we auto-load the contents of import.sql or data.sql.

Spring only does this for embedded databases.
'Normal' Quarkus only does this in dev and tests mode (which is a similar intention).
But with the Spring compatibility extensions, we do it even in prod.

To reproduce, comment out the disabling of the hibernate-orm load in https://github.com/quarkusio/spring-quarkus-perf-comparison/blob/main/quarkus3-spring-compatibility/src/main/resources/application.yml. (It may need quarkusio/spring-quarkus-perf-comparison#23 to merge first.) The integration tests will fail, because all of a sudden there's extra data from data.sql in the prod database.

I don't know if we should fix this since it would be a behaviour change to behaviour people might have been depending on, even though it feels more consistent. But raising this issue to track the discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/springIssues relating to the Spring integrationkind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions