I have search for solutions and I cant find any, I have tried just about everything I can and nothing works.
I have this code...
Code:
@Override
public void updateUser(UserModel model) {
Session session = sessionFactory.getCurrentSession();
session.saveOrUpdate(model);
}
where sessionFactory is a spring managed bean, and I am using a HibernateFilter to OpenSessionInView, and using HibernateTransaction management proxy to manage the transactions.
I have tried everything in this function, update, save, merge, using my own transactions where I begin the transaction and commit it in the same function call, I have flushed the session, and closed the session, and nothing works, hibernate will not write update information to the database.
When I unit test this DAO there isnt any problems, it works fine, the test and the spring server use the same hibernate configuration file. The UserModel is first retrieved from the database, some work is done on it, then its passed to this update function, where I am updating the last login time which is what I am expecting to be updated, and it just will not commit the changes, I have been on this for atleast 2 days now. Is there any reason why this wouldnt work?