-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate::Data perist before commit
PostPosted: Fri Jan 23, 2009 3:29 am 
Newbie

Joined: Thu Oct 30, 2008 9:27 am
Posts: 10
Location: indore
I am using Hibernate Transaction and the code is
sessionFactory.getCurrentSession().getTransaction().begin();
i have started transaction but problem is that i have inserted 2 rows with my code but in 2nd row some data is wrong so exception occurs but first row inserted successfully and second not i suppose transaction is commited but i commited the transaction after for loop.i think hibernate persist data on save() or saveorupdate() i think it is tranasient data so it is persisting data any body having idea please let me know.....

Thanks in advance...

_________________
Naresh Bahety
Software Engineer
Impetus Infotech Pvt Ltd Indore
Cell:9893073973


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 23, 2009 12:05 pm 
Regular
Regular

Joined: Tue Dec 30, 2008 8:14 pm
Posts: 50
Try setting the FlushMode to COMMIT:
session.setFlushMode(FlushMode.COMMIT);
and do a commit after all the records are inserted.

---
Please rate


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