Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 14622 invoked from network); 21 Jul 2008 08:08:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jul 2008 08:08:05 -0000 Received: (qmail 13758 invoked by uid 500); 21 Jul 2008 08:08:04 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 13545 invoked by uid 500); 21 Jul 2008 08:08:03 -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 13534 invoked by uid 99); 21 Jul 2008 08:08:03 -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 01:08:03 -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 08:07:10 +0000 Received: (qmail invoked by alias); 21 Jul 2008 08:07:34 -0000 Received: from bsl-rtr.day.com (EHLO [10.0.0.64]) [62.192.10.254] by mail.gmx.net (mp021) with SMTP; 21 Jul 2008 10:07:34 +0200 X-Authenticated: #894343 X-Provags-ID: V01U2FsdGVkX1/7sbhh3Xr7JbHRJsiAmJmOTTfZguctlH/WKyRr+y d1K1z6jnfpTiyp Message-ID: <488443C3.3070109@gmx.net> Date: Mon, 21 Jul 2008 10:07:31 +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> <488435BC.3060108@gmx.net> <11910710527.20080721092059@holeczek.de> In-Reply-To: <11910710527.20080721092059@holeczek.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.61 X-Virus-Checked: Checked by ClamAV on apache.org Hi Florian, ah, of course, you are right. Michael, can you tell us what nodes remain in the workspace after you removed the assets node and called save? regards marcel Florian Holeczek wrote: > Hallo Marcel, > > are you sure about this? I thought Michael's code produced the > following tree: > > root > | > assets > / \ > asset[1] asset[2] > > Regards, > Florian > > Urspr�ngliche Nachricht vom 21.07.2008 um 09:07: >> 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 >