openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jody Grassel (JIRA)" <>
Subject [jira] [Resolved] (OPENJPA-2450) Option to disable execution of ALTER SEQUENCE...INCREMENT BY statement for sequences.
Date Mon, 03 Feb 2014 21:51:08 GMT


Jody Grassel resolved OPENJPA-2450.

       Resolution: Fixed
    Fix Version/s: 2.3.1

> Option to disable execution of ALTER SEQUENCE...INCREMENT BY statement for sequences.
> -------------------------------------------------------------------------------------
>                 Key: OPENJPA-2450
>                 URL:
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: sql
>            Reporter: Heath Thomann
>            Assignee: Heath Thomann
>            Priority: Minor
>             Fix For: 2.1.2,, 2.2.3, 2.3.1, 2.4.0
>         Attachments: OPENJPA-2450-2.2.1.x.patch
> OpenJPA attempts to execute an ALTER SEQUENCE....INCREMENT BY SQL statement for a user
defined sequence.  This is done to ensure that the 'allocationSize' value defined by the entity's
sequence, or default value, matches the sequence defined in the database.  For example, with
an allocationSize of 1000 for a sequence named 'SEQ_JPASAMPLE', the following SQL will be
generated (the SQL might vary slightly depending on the databases): 
> If the user executing this command doesn't have permissions to execute the command, it
will fail and in turn OpenJPA will disable sequence caching.  User's have asked for a way
to disable this SQL statement and have full control over the sequence they define in their
domain model and its corresponding definition in the database.
> We can easily add a property to disable this SQL statement.  However, the onus is then
on the user to ensure that they keep in sync the 'allocationSize' in their entity's sequence
definition with the 'INCREMENT BY' for the corresponding sequence in the database.
> To disable this sequence I propose a new property on DBDictionary named 'disableAlterSeqenceIncrementBy',
with a default of false.  I also propose adding a warning message, logged once, when this
property is enabled and we avoid executing the SQL.
> Thanks,
> Heath Thomann

This message was sent by Atlassian JIRA

View raw message