From 1e589ddd62ec068e3797f351566ff62274a549ba Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Thu, 31 Jul 2014 20:20:12 +1000 Subject: [PATCH] only close session if open getJcrSession will open one if needed, which close does not need to do. This also caused some timing issues in the REST tests as it concurrently operated on the same session --- .../repository/jcr/JcrMetadataRepository.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java index e6c18675b..fbfe37386 100644 --- a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java +++ b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java @@ -1313,17 +1313,9 @@ public class JcrMetadataRepository public void close() throws MetadataRepositoryException { - try + if ( jcrSession != null && jcrSession.isLive() ) { - if ( getJcrSession().isLive() ) - { - getJcrSession().logout(); - } - } - catch ( RepositoryException e ) - { - log.error( e.getMessage(), e ); - throw new MetadataRepositoryException( e.getMessage(), e ); + jcrSession.logout(); } } -- 2.39.5