Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate which generator to use in clustered environment

 
lavnish lalchandani
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have often read "not to use Increment generator type in clustered deployment environment"
but my ques is which one should be used in clustered environment ?? any of the remaining ?
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Hibernate specific ‘increment’ generator can not safely be used in a clustered environment. However any of the standards compatible ones (TABLE, SEQUENCE, IDENTITY) can. With the table strategy you get good performance and portability. With sequence you get performance but lose portability, identity is the weakest of the 3 on performance (no pre-allocation) and also not portable across all databases.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic