Skip to content

@Modifying does not flush session when put over method defined in custom implementation [DATAJPA-1445] #1762

Open
@spring-projects-issues

Description

@spring-projects-issues

Сергей Цыпанов opened DATAJPA-1445 and commented

Consider the method

@Override
@Modifying(flushAutomatically = true)
public void deleteContractDataBySnapshotId(Long snapshotId) {
  //getSession().flush();
  String query = "delete from table sn where sn.smth = true ";
  getSession().createNativeQuery(query)
    .addSynchronizedQuerySpace("") //keep 2nd level cache
    .executeUpdate();
 }

This code doen't flush session which is why we have to uncomment

getSession().flush()

I think this behaviour is not correct, otherwise this must be specified in javadoc


No further details from DATAJPA-1445

Metadata

Metadata

Assignees

Labels

in: coreIssues in core supporttype: bugA general bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions