Hello guys,
I have below method which fetches data base on record Id, and if found set a new name to update the record.
My problem is, when i set the new name, it doesn't show on the record. Meaning the update doesn't persist. Do anyone know what I am doing wrong?
Code:
@Transactional(propagation = Propagation.REQUIRED)
private void run() throws Exception {
try{
Person object= (Person) getById(139);
object.setName("Testing 123");
System.out.println("Name: "+ object.getName());
} catch (Exception e) {
e.printStackTrace();
}
}