• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

update problem

 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tried to do the update for records, but the datas are not being update and there are no errors.

im using hibnerateUtils.update(oSession,obj);

I pass in the session and the Object to be updated. but the datas in the DB does not change. In the console, the update HQL did print out.

Im really lost in this. thanks.
 
saranga rao
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can you give more details related to tables/Codes/database connection/hbm.xml/main?



regards
Saranga
 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
update function:


main():


from the console, this line is printed:
Hibernate: update CTHREAD set TOPIC_ID=?, MSG_TEXT=?, EMAIL_ADDR=?, SUBMIT_USER_ID=?, CREATED_DATE=?, THREAD_STATUS=?,
QUERY_REFERENCE_NO=?, QUERY_STATUS=?, LAST_MODIFY_DATE=?, RESOLUTION_MODE=?, RESOLUTION_STATUS=? where ID=?


mapping:

[ May 10, 2007: Message edited by: lynn fann ]
 
karthick swami
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To save changes to database:

A transaction has to be opened for the session.

Transaction txn = session.beginTransaction();

session.flush();
txn.commit();
session.close();

Only when transaction.commit is done it will reflect in the DB.
 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, i try that out. thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic