In fact, I have to do some action like :
- Get object from the data base
- Save object in the data base
Currently in my DAO implementation object I have this method :
Code:
public boolean update(Object dossier) {
Session session = HibernateUtil.getSession();
Transaction transaction = session.beginTransaction();
session.saveOrUpdate(dossier);
transaction.commit();
session.close();
return true;
}
But it was said to me that I need to manage the transaction in highter level.
Because a save of one object can need to save others object in the future and I need to be sure that my transaction is arround all the operation to do...