How to force update bean in Transactional & Asyn Method in spring boot?
I want it to save immeditaly at specific point and not at the end of the transactional function
import javax.transaction.Transactional;
`@Service
@Transactional
public class CustomerServiceImpl implements CustomerService {
@Autowired
private CustomerRepository customerRepository;
@Override
@Async
public void sendAllWithQueryParam(Customer customer) {
// some code
customerRepository.save(customer);
// extre code
}
}`
Also note that, when I added @org.springframework.transaction.annotation.Transactional(propagation = Propagation.REQUIRES_NEW) to the method, it also doesn’t work
Ibrahim Ali Mohamed is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.