Return-Path: Delivered-To: apmail-sling-commits-archive@www.apache.org Received: (qmail 92567 invoked from network); 8 Mar 2010 16:32:20 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Mar 2010 16:32:20 -0000 Received: (qmail 16294 invoked by uid 500); 8 Mar 2010 16:31:56 -0000 Delivered-To: apmail-sling-commits-archive@sling.apache.org Received: (qmail 16259 invoked by uid 500); 8 Mar 2010 16:31:55 -0000 Mailing-List: contact commits-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list commits@sling.apache.org Received: (qmail 16252 invoked by uid 99); 8 Mar 2010 16:31:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Mar 2010 16:31:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Mar 2010 16:31:53 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4B0A62388978; Mon, 8 Mar 2010 16:31:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r920391 - /sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/TimedJobHandler.java Date: Mon, 08 Mar 2010 16:31:32 -0000 To: commits@sling.apache.org From: cziegeler@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100308163132.4B0A62388978@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: cziegeler Date: Mon Mar 8 16:31:31 2010 New Revision: 920391 URL: http://svn.apache.org/viewvc?rev=920391&view=rev Log: Minor code cleanup Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/TimedJobHandler.java Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/TimedJobHandler.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/TimedJobHandler.java?rev=920391&r1=920390&r2=920391&view=diff ============================================================================== --- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/TimedJobHandler.java (original) +++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/TimedJobHandler.java Mon Mar 8 16:31:31 2010 @@ -214,7 +214,7 @@ if ( foundNode != null ) { try { foundNode.remove(); - parentNode.save(); + writerSession.save(); } catch (LockException le) { // if someone else has the lock this is fine } @@ -226,7 +226,7 @@ if ( foundNode != null ) { try { foundNode.remove(); - parentNode.save(); + writerSession.save(); } catch (LockException le) { // if someone else has the lock this is fine } @@ -333,7 +333,6 @@ // we create an own session here Session s = null; try { - s = this.createSession(); while ( iter.hasNext() ) { final javax.jcr.observation.Event event = iter.nextEvent(); if ( event.getType() == javax.jcr.observation.Event.PROPERTY_CHANGED @@ -346,6 +345,9 @@ // we are only interested in unlocks if ( "jcr:lockOwner".equals(propertyName) ) { try { + if ( s == null ) { + s = this.createSession(); + } final Node eventNode = (Node) s.getItem(nodePath); if ( !eventNode.isLocked() ) { try { @@ -490,7 +492,7 @@ if ( eventNode != null ) { try { eventNode.remove(); - parentNode.save(); + s.save(); } catch (RepositoryException re) { // we ignore the exception if removing fails ignoreException(re); @@ -761,10 +763,9 @@ // we should remove the node from the repository // if there is no node someone else was faster and we can ignore this if ( foundNode != null ) { - final Node parentNode = foundNode.getParent(); try { foundNode.remove(); - parentNode.save(); + writerSession.save(); } catch (LockException le) { // if someone else has the lock this is fine }