Skip to main content

Problem

  • Product Name: AppServer
  • Product Version: 6.5
  • Product Component: JSS (Java Session Service)
  • Platform/OS Version: All
  • JDK/Compiler Version: Supported JDK

Following are two questions regarding "failover for JSS":

a. Is it possible to configure two JSS instances, both pointing to the same JDBC backing store?

b. Will the individual instances generate unique keys or is the key generation mechanism such that they would collide?JSS (or the EJB container) appears to assign the key sequentially starting at zero in the JSS_EJB table. Where does the key generation come from and is there a chance of collision in the JSS_EJB table if two JSS instances are running?

Resolution

a. Yes, it is possible to configure two JSS instances, both pointing to the same JDBC datasource.

b. Please see the explanation below for the Key Generation Mechanism.

When a Session Key is generated in the EJB : A chunk or block of numbers is acquired first from the storage and then the keys are generated sequentially within that block. The size of this chunk is Integer.MAX value. The JSS maintains something called a KEY_BASE in the JSS_KEYS table which stores the maximum number that has been allocated till now. Initially the KEY_BASE is set to 0.

Suppose one JSS acquired the block of size Integer.MAX, (i.e. 0 to Integer.MAX-1) then the KEY_BASE value is set to Integer.Max so that it allocates a newer chunk next time. If another JSS is also pointed to the same JDBC Store it will acquire a chunk of Integer.Max size in the range of numbers Integer.Max to 2*Integer.Max-1. Hence there will be no conflict or collision in the key values generated. There should be no conflict until all Key values are exhausted and reach the Long.Max value which is hardly expected to happen given that 2^63-1 key values need to be exhausted.


#VisiBroker
#JDBCBackingstore
#JDBCdatasource
#AppServer
#JSS
#Security