Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 45530 invoked from network); 21 Jul 2008 15:01:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jul 2008 15:01:28 -0000 Received: (qmail 46617 invoked by uid 500); 21 Jul 2008 15:01:20 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 46604 invoked by uid 500); 21 Jul 2008 15:01:20 -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 46590 invoked by uid 99); 21 Jul 2008 15:01:20 -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 08:01:19 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of michael.e.harris@gmail.com designates 216.239.58.187 as permitted sender) Received: from [216.239.58.187] (HELO gv-out-0910.google.com) (216.239.58.187) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jul 2008 15:00:27 +0000 Received: by gv-out-0910.google.com with SMTP id n40so121256gve.18 for ; Mon, 21 Jul 2008 08:00:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=MpTDGZ+0+Ga+LgpA+Xbj6SwkqIW21VGSYRe2vOzFbII=; b=vPGP4cw0GX/Ov3PU8MlGui8jsAO8sioMpZSm7KfSoMN2yXXsoKi4beu2nA56CH/t+k 16PmtAdpFgzubC3wwh7EkTluV9VHw8MSWPDz3Ubx/mupDSieY8V90UVQiBbbXOrWdzMi zfETquCH3M8cHGizpNk02cAVVAb5HkwM++faM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=mY7yoBxbdwJ9HQry0rBr8VOKMhTIPqYbIz8GVaenFgcatX5Klv4hvyFbxLamdzYCrV L5KMMeg6z6iqA1U8J9Is4fnnhsbmly9NBeNdCXLaNE3Asbb5GNBze0HVojozM8dSjjg7 Guh3PxWaKTx/Bq0jt8LPgC2dF3Z5Lf2V9FdFg= Received: by 10.103.222.12 with SMTP id z12mr2692218muq.12.1216652449319; Mon, 21 Jul 2008 08:00:49 -0700 (PDT) Received: by 10.103.22.2 with HTTP; Mon, 21 Jul 2008 08:00:49 -0700 (PDT) Message-ID: <82670ba40807210800k66899cc9k67650bc482becda@mail.gmail.com> Date: Mon, 21 Jul 2008 11:00:49 -0400 From: "Michael Harris" To: users@jackrabbit.apache.org Subject: Re: newb transient repository questions In-Reply-To: <488443C3.3070109@gmx.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_38876_7570613.1216652449320" References: <82670ba40807180622j600c5461mf4bf311a67f241ec@mail.gmail.com> <82670ba40807180740o42a75384m21d303c35ce54c03@mail.gmail.com> <82670ba40807180759l69c8e763g398d10f8399088b8@mail.gmail.com> <488435BC.3060108@gmx.net> <11910710527.20080721092059@holeczek.de> <488443C3.3070109@gmx.net> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_38876_7570613.1216652449320 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline So I ran my tests a bunch of times without the delete code. asset[x] instances accumulated. I then tried adding the cleanup code in and thought that it wasn't cleaning up. however, I deleted the repo root, and now when i run the tests they clean up. So the problem has gone away.... On Mon, Jul 21, 2008 at 4:07 AM, Marcel Reutegger wrote: > 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=FCngliche Nachricht vom 21.07.2008 um 09:07: >> >>> Hi Michael, >>> >> >> Michael Harris wrote: >>> >>>> another noob question. I have the following codes >>>> >>>> Node root =3D session.getRootNode(); >>>> Node assets =3D root.addNode("assets"); >>>> >>>> // Store content >>>> Node asset =3D assets.addNode("asset"); >>>> asset.setProperty("url", "http://asset1url.org"); >>>> asset.setProperty("name", "Asset 1"); >>>> asset.setProperty("typetype", "image"); >>>> >>>> Node asset2 =3D 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 =3D session.getRootNode(); >>>> Node assets =3D 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 =3D root.getNodes("assets"); assets.hasNext();= ) { >>> assets.nextNode().remove(); >>> } >>> session.save(); >>> >> >> regards >>> marcel >>> >> >> > --=20 --------------------- Michael Harris ------=_Part_38876_7570613.1216652449320--