Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Update/Insert optimization in hibernate

 
S Shukla
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using hibernate 2.1 for saving a class in database. The class contains many-to-one mapping with another class. I update the existing instance if the class already exists in database. Right now after flushing after each seesion.save or session.update. This is taking a lot of time. Is there any way to optimize it. How can I use batching?
 
Loren Rosen
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably don't need to explicitly call flush(). Hibernate will do this for you when you commit your transaction.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic