Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-1982

Mismatched Sequence Cache for Database Sequence Generated Keys

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.1
    • 4.0.M2
    • Core Library
    • None

    Description

      I've seen this myself, but it was also raised on the mailing list today. The system has a sequence with an "increment_by" value of 1. This generates an increment of 1 for each query to get the next value.

      Cayenne on the other hand has a default cache of 20 defined at JdbcPkGenerator#DEFAULT_PK_CACHE_SIZE. This creates a problem because Cayenne assigns PK's 1..20 for its use, but the sequence is only incremented by 1 in the database.

      Maybe look at generating corrected DDL or defaulting to a cache of 1 for the case where primary keys are being database generated.

      Attachments

        Activity

          People

            Unassigned Unassigned
            apl Andrew Ponsonby Lindesay
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: