Skip to content

@Modifying clearAutomatically default value is true [DATAJPA-31] #470

@spring-projects-issues

Description

@spring-projects-issues

Dragan Gajic opened DATAJPA-31 and commented

The default value of clearAutomatically element of @Modifying is true, which result in clearing persistent context after execution of query. If this modifying query is part of sequence of other update operations, for example when in the service layer we combine calls to several DAOs, clearing persistent context by default can lead to unexpected results. Since the service layer methods are usually bounded by transaction, which end is trigger for synchronization all update operations (merge) before modifying query may be loss because of the cleared persistence context.

I believe this is not uncommon situation, so in that sense maybe it is more appropriate to have this option as false by default.


Affects: 1.0 M1

Referenced from: commits 762e57c

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions