Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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.

 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!