-->
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.  [ 4 posts ] 
Author Message
 Post subject: problem with session?
PostPosted: Fri Apr 18, 2008 1:17 am 
Newbie

Joined: Fri Apr 18, 2008 1:07 am
Posts: 14
Location: Pakistan
Hello All!

I am having problem with session.save(), session.update() and session.delete(). When I call the functions, I cannot see any changes in the database tables. Please give me some solution. I will be grateful.

_________________
Muhammad Kashif Nazar
Software Engineer


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 18, 2008 2:21 am 
Regular
Regular

Joined: Mon Aug 06, 2007 10:49 am
Posts: 67
Location: Banska Bystrica, Slovakia
do u use transactions?

http://www.hibernate.org/42.html


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 18, 2008 2:26 am 
Newbie

Joined: Fri Apr 18, 2008 1:07 am
Posts: 14
Location: Pakistan
Thanks for you quick response!

No sir, I am just calling session.save(); as follows.


User user=new User();
session.save(user);

_________________
Muhammad Kashif Nazar
Software Engineer


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 18, 2008 2:38 am 
Beginner
Beginner

Joined: Wed Mar 05, 2008 4:57 am
Posts: 22
Location: Bangalore,India
You need to put ur code of update/save/delete in a transaction.

session.getTransaction().begin();
---
---
session.getTransaction().commit();

_________________
Naresh Waswani
+91-9986461501


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.