• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

update problem

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok, i try that out. thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic