From users-return-17905-apmail-jackrabbit-users-archive=jackrabbit.apache.org@jackrabbit.apache.org Thu Aug 18 11:17:11 2011 Return-Path: X-Original-To: apmail-jackrabbit-users-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0612E89F2 for ; Thu, 18 Aug 2011 11:17:11 +0000 (UTC) Received: (qmail 17563 invoked by uid 500); 18 Aug 2011 11:17:09 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 16259 invoked by uid 500); 18 Aug 2011 11:16:57 -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 15803 invoked by uid 99); 18 Aug 2011 11:16:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Aug 2011 11:16:50 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of david.buchmann@liip.ch designates 207.126.144.139 as permitted sender) Received: from [207.126.144.139] (HELO eu1sys200aog115.obsmtp.com) (207.126.144.139) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Aug 2011 11:16:44 +0000 Received: from mail-wy0-f173.google.com ([74.125.82.173]) (using TLSv1) by eu1sys200aob115.postini.com ([207.126.147.11]) with SMTP ID DSNKTkz0hLtkoksUK1PXpSgfIfXbXpWTOkoh@postini.com; Thu, 18 Aug 2011 11:16:22 UTC Received: by mail-wy0-f173.google.com with SMTP id 22so1525331wyf.4 for ; Thu, 18 Aug 2011 04:16:20 -0700 (PDT) Received: by 10.216.236.15 with SMTP id v15mr455293weq.112.1313666179935; Thu, 18 Aug 2011 04:16:19 -0700 (PDT) Received: from [10.0.0.105] (cust.static.109-164-240-33.swisscomdata.ch [109.164.240.33]) by mx.google.com with ESMTPS id s1sm1402353wec.44.2011.08.18.04.16.18 (version=SSLv3 cipher=OTHER); Thu, 18 Aug 2011 04:16:19 -0700 (PDT) Message-ID: <4E4CF481.9030409@liip.ch> Date: Thu, 18 Aug 2011 13:16:17 +0200 From: David Buchmann User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 MIME-Version: 1.0 To: users@jackrabbit.apache.org Subject: Session.refresh(true) behaviour X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hi, the documentation [1] [2] is not very explicit how conflicts should be resolved. i wrote some simple test code, see below. is it correct that whenever i delete something on the server or move it somewhere else, the refresh(true) still changes the modified node to be deleted? Session s = repository.login(sc,workspace); Node n = s.getNode("/test"); Node n2 = n.addNode("childname", "nt:folder"); s.save(); // delete the node in a separate session Session s2 = repository.login(sc,workspace); s2.removeItem("/test/childname"); // or just s2.move("/test/childname", "/xy"); s2.save(); // add a child to the node in the first session Node n3 = n2.addNode("deepchild"); // keep local changes s.refresh(true); // but our local change "create a node" is lost System.out.println(n3.getPath()); cheers,david [1] http://www.day.com/specs/jcr/2.0/10_Writing.html#10.11.1%20Refresh [2] http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Session.html#refresh(boolean) - -- Liip AG // Agile Web Development // T +41 26 422 25 11 CH-1700 Fribourg // PGP 0xA581808B // www.liip.ch -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk5M9H0ACgkQqBnXnqWBgIsZ7ACcC/5FomxChgvw7opEoxRS6LQk mw8AoKBwWr2Ur3iwrkov3ucX1kzSur1F =Q5z5 -----END PGP SIGNATURE-----