If I fetched an Object from the database and passed that object to another internal method which will basically do some modification and save that into db and then after that parent method modifies the fetched object and saves it as well. Refer below code snippet for more clarification
@Transactional
public A(){
Object obj = dao.get(id)
method(obj);
obj.setSomeFiled(field);
dao.save(obj);
}
@Transactional(propogate new)
public B(Obj obj){
obj.setAnotherField();
obj = dao.save()
}
Is this valid behaviour in Spring Boot Hibernate? Also, what will be the order of execution?