Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9E49F10F0E for ; Thu, 5 Dec 2013 19:37:37 +0000 (UTC) Received: (qmail 61879 invoked by uid 500); 5 Dec 2013 19:37:36 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 61836 invoked by uid 500); 5 Dec 2013 19:37:36 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 61788 invoked by uid 99); 5 Dec 2013 19:37:36 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Dec 2013 19:37:36 +0000 Date: Thu, 5 Dec 2013 19:37:36 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: dev@openjpa.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (OPENJPA-2450) Option to disable execution of ALTER SEQUENCE...INCREMENT BY statement for sequences. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-2450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13840469#comment-13840469 ] ASF subversion and git services commented on OPENJPA-2450: ---------------------------------------------------------- Commit 1548252 from [~fyrewyld] in branch 'openjpa/branches/2.2.x' [ https://svn.apache.org/r1548252 ] OPENJPA-2450: Option to disable execution of ALTER SEQUENCE...INCREMENT BY statement for sequences. > Option to disable execution of ALTER SEQUENCE...INCREMENT BY statement for sequences. > ------------------------------------------------------------------------------------- > > Key: OPENJPA-2450 > URL: https://issues.apache.org/jira/browse/OPENJPA-2450 > Project: OpenJPA > Issue Type: Improvement > Components: sql > Reporter: Heath Thomann > Assignee: Heath Thomann > Priority: Minor > Fix For: 2.1.2, 2.2.1.1, 2.2.3, 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): > ALTER SEQUENCE SEQ_JPASAMPLE INCREMENT BY 1000 > 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 (v6.1#6144)