• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

hibernate property order_insert / order_update

 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI All,
Lets consider a relationship Book -> Chapter
For every Book insertion, hibernation will insert two insert One for Book and another for Chapter. Hibernate 'batch_size' option will fail here because it only BATCHes statements when same type of statement are going to be insert. Here there are alternating statement for Book and Chapter so Hibernate will insert by every insert.
So for maximize performance, we can set property 'order_insert=true' , it will sort the same type of statements and BATCH will come in picture then and performance will improved.

Now the problem is, if it is unidirection association and Chapter stores FK to Book and after sorting the insert statement, if all CHAPTERs get inserted first then will any error come there because till that time you don't have BOOK id.

Hope, I am able to make you understand my query.

Thanks.
 
shai ban
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
does that means nobody knows about it or I am not able to make you understand

Thanks.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic