2 Replies Latest reply on Sep 30, 2002 1:14 PM by Alexey Loubyansky

    Primary key generation

    Dave Newbie


      I have a question regarding the retrieval of unique primary keys. I use JBoss 3.0.2 with CMP EJBs.

      At the moment I use a seperate table which stores the last added unique ids for my tables, and handles concurrency issues.

      BUT, this all worked fine till the database got shared.
      Now there are also other programs which also add data to the database and which use at this moment a get MAX + 1 query to retrieve the next unique id to use. So this obviously will lead to problems.

      What's the best solution, approach to tackle down this problem ?