Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Batch with <join>

 
Vignesh Murali Natarajan
Ranch Hand
Posts: 65
Firefox Browser Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm facing a problem with getting Hibernate to do batch inserts. I have an Entity (called 'Extract') that has a component class which is mapped to a secondary table using <join> element. It also has a <one-to-many> relationship with a different entity. When I try to do a batch insert of Extract objects, Hibernate does not seem to be batching them. So if there were 10000 Extract records to be inserted, Hibernate generates 10000 inserts and runs batch sizes of 1. I have set my batch_size to 50, enabled order_inserts & order_updates. However if I remove the <join> element from the mapping, Hibernate does the batching correctly. Please correct me if my understanding is incorrect

Here are excerpts from my src

hibernate cfg xml


The Extract hbm



The entity classes are just POJOs.

Please help!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic