Hello guys,
I have a method within my GenericDao which does Save or Update as shown below:
Code:
public D Upsert(D entity) throws Exception {
getCurrentSession().saveOrUpdate(entity);
return entity;
}
In my Object Dao class I do something like this;
Code:
@Transactional(propagation = Propagation.REQUIRED)
public void doSave(String age, String tel, String book_type) throws Exception{
Person person = new Person(age, tel, book_type);
Upsert(person);
//Confirm the Record ID
System.out.println(person.getId());
}
If execute the doSave method a new Person object is created and Id printed to console.
Problem:
My problem is when I inspect the physical table's to fetch this record, it doesn't exist, or any physical commit made. Do anyone knows what's going on here?