However, some Jive users with huge amounts of traffic or very stringent reliability requirements may need to take special measures to optimize Jive for their needs. The goal of this document is to provide an overview of the changes necessary to use Jive in a multi-appserver environment. Those that find the performance of Jive on one app server adequate and reliable enough should not apply these changes. The aim of Jive 1.0 was to work with maximum speed on one app server on the broadest range of platforms. For those reasons, it is not actually possible to run Jive out of the box on multiple app servers without running into serious problems.
Jive changes is to support scalability and fault-tolerance natively.
The basic algorithm is to query the database at startup for the largest ID of a particular type. Jive then keeps a synchronized counter of the next available ID and increments it as objects are created. You'll find the methods that need to be changed in the DbSequenceManager.java class. In that class, you'll notice that an internal Counter class is used to keep track of the count. Examining the implementation of the Counter class reveals that an intial db query is made, followed by synchronized int increments.