Skip to content

Commit 33d3724

Browse files
committed
Refine performance requirements on derived delete queries.
Closes #3177
1 parent 241a466 commit 33d3724

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: src/main/antora/modules/ROOT/pages/jpa/query-methods.adoc

+3
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,9 @@ To make sure lifecycle queries are actually invoked, an invocation of `deleteByR
640640

641641
In fact, a derived delete query is a shortcut for running the query and then calling `CrudRepository.delete(Iterable<User> users)` on the result and keeping behavior in sync with the implementations of other `delete(…)` methods in `CrudRepository`.
642642

643+
NOTE: When deleting a lot of objects you will need to consider the performance implications to ensure sufficient memory availability.
644+
All resulting objects are loaded into memory before being deleted and are held in the session until flushing or completing the transaction.
645+
643646
[[jpa.query-hints]]
644647
== Applying Query Hints
645648
To apply JPA query hints to the queries declared in your repository interface, you can use the `@QueryHints` annotation. It takes an array of JPA `@QueryHint` annotations plus a boolean flag to potentially disable the hints applied to the additional count query triggered when applying pagination, as shown in the following example:

0 commit comments

Comments
 (0)