Joined: Tue Jul 27, 2004 1:33 pm Posts: 18 Location: South Africa
|
hi all,
I am doing something quiet straight forward but it doesn work. I get a persistent object from a session. Then I close the session hand the object over to the front-end. Some changes are made on the front-end and the object is sent back. I then open a new session and do a saveOrUpdate.
There are no failure notices but the object does not get persist to the database. This is where I get the object
Session session = this.getSession();
Query query = session.createQuery("from user u where u.Username like :username ");
query.setString("username",userId);
if (query.list().size()==0) {
session.close();
return null;
}
User user = (User)query.list().get(0);
session.close();
return user;
When I try and save the object:
Session session = this.getSession();
session.saveOrUpdate(user);
session.flush();
session.close();
I tried
Session session = this.getSession();
session.merge(user);
session.saveOrUpdate(user);
session.flush();
session.close();
This doesn work either. It is only this one object I have this problem with. Others work fine. :(
_________________ http://www.jumpingbean.co.za http://www.cyberconnect.co.za http://www.ip-pbx.co.za http://www.learndrupal.co.za
|
|