You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
appreciated
changed the title
When using @Query with ResultSetExtractor or a RowMapper a new instance is created on every call
When using @Query with ResultSetExtractor or RowMapper class a new instance is created on every call
Jan 22, 2024
Introduce caching for configured RowMapper/ResultSetExtractor.
We now create RowMapper/ResultSetExtractor instances only once if they are considered static configuration.
A configured RowMapper ref/class is always static.
A configured ResultSetExtractor ref/class is static when the extractor does not accept a RowMapper or if the RowMapper is configured.
Default mappers or projection-specific ones require ResultSetExtractor recreation of the ResultSetExtractor is configured as Class.
Reuse TypeInformation as much as possible to avoid Class -> TypeInformation conversion.
Introduce LRU cache for DefaultAggregatePath to avoid PersistentPropertyPath lookups.
Introduce best-effort quoted cache for SqlIdentifier to avoid excessive string object creation.
Closes#1721
Original pull request #1722
When using the
@Query
annotation in Spring Data JDBC, like in the following code snippet: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
The text was updated successfully, but these errors were encountered: