Auto-Primary key generation - Weblogic

This is a discussion on Auto-Primary key generation - Weblogic ; My database is Oracle and I am using Oracle Sequence for enerating Primary key. In Oracle Sequence increment is given as 2. I have defined "cache-size=2". But still I am finding that the Entity bean is increasing the Sequence by ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Auto-Primary key generation

  1. Auto-Primary key generation

    My database is Oracle and I am using Oracle Sequence for enerating Primary key. In Oracle Sequence increment is given as 2. I have defined "cache-size=2". But still I am finding that the Entity bean is increasing the Sequence by 1 in the Database. Can any one guide me if I have missing
    anything or its a bug of Weblogic ?

  2. Re: Auto-Primary key generation


    Hi,

    This is by design. The intent is to have the primary keys increment by 1, thus
    maximizing the set of available primary keys. The cache size is intended to
    have the EJB container 'save up' primary key values thus reducing the number
    of trips required to the database and improving performance.

    Hope this helps

    -thorick



+ Reply to Thread