From graffito-dev-return-1406-apmail-incubator-graffito-dev-archive=www.apache.org@incubator.apache.org Sun Sep 24 13:00:10 2006 Return-Path: Delivered-To: apmail-incubator-graffito-dev-archive@www.apache.org Received: (qmail 68018 invoked from network); 24 Sep 2006 13:00:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Sep 2006 13:00:10 -0000 Received: (qmail 23983 invoked by uid 500); 24 Sep 2006 13:00:09 -0000 Mailing-List: contact graffito-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: graffito-dev@incubator.apache.org Delivered-To: mailing list graffito-dev@incubator.apache.org Received: (qmail 23971 invoked by uid 99); 24 Sep 2006 13:00:09 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Sep 2006 06:00:09 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [209.237.227.198] ([209.237.227.198:57872] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id BF/00-09649-65186154 for ; Sun, 24 Sep 2006 06:00:06 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5B2EC4190CE for ; Sun, 24 Sep 2006 12:56:22 +0000 (GMT) Message-ID: <22343354.1159102582370.JavaMail.jira@brutus> Date: Sun, 24 Sep 2006 05:56:22 -0700 (PDT) From: "Dan Connelly (JIRA)" To: graffito-dev@incubator.apache.org Subject: [jira] Created: (GRFT-106) Avoid INFINITE RECURSION when Object Model has cycles. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Avoid INFINITE RECURSION when Object Model has cycles. ------------------------------------------------------ Key: GRFT-106 URL: http://issues.apache.org/jira/browse/GRFT-106 Project: Graffito Issue Type: Improvement Components: JCR-Mapping Reporter: Dan Connelly Priority: Critical The default ObjectConverterImpl is restricted to acyclic graphs in the object model. Many Java object models are NOT acyclic. For instance, I am on your Friends list. Yoar are on my Friends list. Java encourages such structures. Almost any large object model in Java will have hidden cycles. Saving an Object Model that contains cycles using Graffito causes an infinite recursion. Clearly, it is important to maintain a 1-to-1 correspondence between Nodes and Objects to prevent this. In the absence of Multiple Parent Nodes, it will be necessary to use REFERENCE or UNDEFINED Items in place of the 2nd (or greater) Node representing a given Object. My preference si that the default ObjectConverterImpl should support REFERENCE., Failing this, use of UNDEFINED also solves this problem and would acceptable (as default). Whether or not REFERENCE is used, both insertion and retrieval must provide a reasonable result. A custom ojbect converter should be available to switch UNDEFINED to REFERENCE, or vice versa. Also, it is probably best to keep the targeted, well-defined Nodes close to the Root Node. This implies that the default ObjectConverterImpl should implement a Breadth-First, rather than a Depth-First, traversal of the Object Model on both insertion and retrieval. Again, if the default is Depth-First, a custom object converter should be available that implements Breadth-First. Admittedly, support for (2 representations) X (2 traversals) implies a drastic refactoring and/or rewriting of the ObjectConverterImpl class. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira