Skip to content

When using @Query with ResultSetExtractor or RowMapper class a new instance is created on every call #1721

Closed
@appreciated

Description

@appreciated

When using the @Query annotation in Spring Data JDBC, like in the following code snippet:

@Query(value = "SELECT ...", resultSetExtractorClass = ...ResultSetExtractor.class)
List<SomeModel> someSpecialQuery();

It appears that a new instance of the ResultSetExtractor/ RowMapper is recreated on every call to the someSpecialQuery method.

This does not happen if the "ref" Parameter is being used.

Is this intended behaviour?

I'm using spring-boot-starter-data-jdbc:3.1.2

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions