I have a REST API project with Spring (5.7.2) Web / Security.
I have just one table discs, it contain a id, and a name.
public class DiscsRepository extends JpaRepository<Discs, Integer> {
}
When I delete a disc, my DiscsService do
discsRepository.deleteById(5);
When I want insert or update I do :
discsRepository.save(myDisc);
I read that flush() is used when you want use the value in same transaction (before commit) and that flush() will synchronize and empty the SQL cache.
In my case I see that I have the value inserted / updated or deleted in my database.
Should I use flush() (I think no) but maybe I mistaken ?