-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Run Successfully but.......
PostPosted: Wed Jul 18, 2007 5:11 am 
Newbie

Joined: Thu Feb 01, 2007 1:57 am
Posts: 17
Location: Mumbai
Hi All,

My programe run Successfully but data don't get save in database plz help me.
Waiting..........................


output on consol:-------
===============================================
Hibernate: select max(id) from cd2
Hibernate: insert into cd2 (title, artist, purchasedate, cost, cd_type, id) values (?, ?, ?, ?, 'cd', ?)
Hibernate: insert into cd2 (title, artist, purchasedate, cost, newfeatures, cd_type, id) values (?, ?, ?, ?, ?, 'SpecialEditionBook', ?)
Hibernate: insert into cd2 (title, artist, purchasedate, cost, languages, region, cd_type, id) values (?, ?, ?, ?, ?, ?, 'InternationalBook', ?)

Process completed.

===============================================

thanks in adv.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 18, 2007 5:26 am 
Regular
Regular

Joined: Mon Apr 02, 2007 3:54 am
Posts: 67
Location: Hyderabad
Be clear. after saving object, r u commiting transaction


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 18, 2007 5:39 am 
Newbie

Joined: Thu Jun 28, 2007 9:39 am
Posts: 9
if you open any transation then u need to commite those.


Top
 Profile  
 
 Post subject: what is wrong with this
PostPosted: Wed Jul 18, 2007 5:39 am 
Newbie

Joined: Thu Feb 01, 2007 1:57 am
Posts: 17
Location: Mumbai
hi,
this is code what is wrong with this.

Book cd = new Book("Book", "R", new Date(), 9.99);
SpecialEditionBook secd = new SpecialEditionBook("sBook", "R", new Date(), 9.99, "W");
InternationalBook icd = new InternationalBook("IBook", "R", new Date(), 9.99, "S", 4);

session.save(cd);
session.save(secd);
session.save(icd);

session.flush();
session.close();





thsnks,


Top
 Profile  
 
 Post subject: thanks
PostPosted: Wed Jul 18, 2007 6:54 am 
Newbie

Joined: Thu Feb 01, 2007 1:57 am
Posts: 17
Location: Mumbai
Thanks
my problem has been solved.
i am missing
commit();

thanks again.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.