Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 87880 invoked from network); 21 Jul 2008 07:08:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jul 2008 07:08:14 -0000 Received: (qmail 57200 invoked by uid 500); 21 Jul 2008 07:08:13 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 57184 invoked by uid 500); 21 Jul 2008 07:08:13 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 57173 invoked by uid 99); 21 Jul 2008 07:08:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jul 2008 00:08:13 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of marcel.reutegger@gmx.net designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 21 Jul 2008 07:07:19 +0000 Received: (qmail invoked by alias); 21 Jul 2008 07:07:42 -0000 Received: from bsl-rtr.day.com (EHLO [10.0.0.64]) [62.192.10.254] by mail.gmx.net (mp067) with SMTP; 21 Jul 2008 09:07:42 +0200 X-Authenticated: #894343 X-Provags-ID: V01U2FsdGVkX1+7meJ5Na+7QV+sjOs/Z5GXVSlg4718AsL/hTFh9Z 4XitQ+GJaeO5Lg Message-ID: <488435BC.3060108@gmx.net> Date: Mon, 21 Jul 2008 09:07:40 +0200 From: Marcel Reutegger User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: users@jackrabbit.apache.org Subject: Re: newb transient repository questions References: <82670ba40807180622j600c5461mf4bf311a67f241ec@mail.gmail.com> <82670ba40807180740o42a75384m21d303c35ce54c03@mail.gmail.com> <82670ba40807180759l69c8e763g398d10f8399088b8@mail.gmail.com> In-Reply-To: <82670ba40807180759l69c8e763g398d10f8399088b8@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.68 X-Virus-Checked: Checked by ClamAV on apache.org Hi Michael, Michael Harris wrote: > another noob question. I have the following codes > > Node root = session.getRootNode(); > Node assets = root.addNode("assets"); > > // Store content > Node asset = assets.addNode("asset"); > asset.setProperty("url", "http://asset1url.org"); > asset.setProperty("name", "Asset 1"); > asset.setProperty("typetype", "image"); > > Node asset2 = assets.addNode("asset"); this creates a same named sibling /asset[2] > asset2.setProperty("url", "http://asset2url.org"); > asset2.setProperty("name", "Asset 2"); > asset2.setProperty("type", "image"); > session.save(); > > and then > > Node root = session.getRootNode(); > Node assets = root.getNode("assets"); this will only return the first asset node but not the second one. > assets.remove(); > session.save(); > > the more I run the test, the more nodes I get. Seems like the data in the > TransientRepo is being stored on the disk. The remove is not cleaning it > up. For why? to remove all asset nodes you need to do the following: for (NodeIterator assets = root.getNodes("assets"); assets.hasNext(); ) { assets.nextNode().remove(); } session.save(); regards marcel