Hi Team, I faced one problem, I am not using transaction but I have accessed persistent object. When I am trying to close the session, the updated data is reflected into database. Will session.close() flush the persistent data even I have not used transaction?
Code : ===== try{ ElanTaskFolder folder=(ElanTaskFolder )session.get(ElanTaskFolder.class, folderId);//Get the object using the primary key folder.setStartDate(new Date()); ------- ------- //I am not used flush or commit here. Just accessed db object and set the date only } catch(Exception e{
} finally{ HibernateSessionFactory.closeSession();// The startDate will reflect current Date and Time in database? Actually, the current date is reflected in database. How it possible? }
My conclusion, even close() is going to flush the data into db If i modify the persistent object
|