Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 5719 invoked from network); 3 Mar 2010 17:56:58 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 Mar 2010 17:56:58 -0000 Received: (qmail 20799 invoked by uid 500); 3 Mar 2010 17:56:50 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 20768 invoked by uid 500); 3 Mar 2010 17:56:50 -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 20756 invoked by uid 99); 3 Mar 2010 17:56:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Mar 2010 17:56:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Mar 2010 17:56:49 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 25DC7234C4BB for ; Wed, 3 Mar 2010 17:56:27 +0000 (UTC) Message-ID: <1045956697.40531267638987150.JavaMail.jira@brutus.apache.org> Date: Wed, 3 Mar 2010 17:56:27 +0000 (UTC) From: "Jeremy Bauer (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-1074) OrderColumn does not maintain index upon inter-list element removal In-Reply-To: <1887253072.1241795865652.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-1074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840762#action_12840762 ] Jeremy Bauer commented on OPENJPA-1074: --------------------------------------- I fixed the non-spec compliant behavior described in this JIRA (ie. phase 1 - Per the latest JPA 2.0 spec, a contiguous index value must be maintained.) but the second phase of the JIRA has not been addressed: "The current reordering mechanism does a full delete and reinsert of the container/collection table values if a reorder is required for inserts. For deletes, it just removes entries and leaves an empty index value. The first phase of the fix will be to maintain contiguous ordering using the same mechanism as inserts (delete/re-insert). The second phase will be to update the ChangeTracker to record the indexes of the updated list items and to use that information to provide a more intelligent update strategy in the handlers." A more spec related side effect of OpenJPA's current order column update strategy is that the OrderColumn insertable and updatable attributes may not result in the behavior one may expect since the db operations used to maintain the list do not exactly map to the db operations indicated by these attributes. I spent a few days looking into implementing phase 2, but it turned into a non trivial exercise. > OrderColumn does not maintain index upon inter-list element removal > ------------------------------------------------------------------- > > Key: OPENJPA-1074 > URL: https://issues.apache.org/jira/browse/OPENJPA-1074 > Project: OpenJPA > Issue Type: Bug > Components: jdbc > Affects Versions: 2.0.0-M2 > Reporter: Jeremy Bauer > Assignee: Jeremy Bauer > Priority: Critical > Fix For: 2.0.0 > > > The current order column reordering mechanism does not maintain a contiguous index value when an item is deleted from anywhere except the end of a collection. Per the latest JPA 2.0 spec, a contiguous index value must be maintained. > The current reordering mechanism does a full delete and reinsert of the container/collection table values if a reorder is required for inserts. For deletes, it just removes entries and leaves an empty index value. The first phase of the fix will be to maintain contiguous ordering using the same mechanism as inserts (delete/re-insert). The second phase will be to update the ChangeTracker to record the indexes of the updated list items and to use that information to provide a more intelligent update strategy in the handlers. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.