diff options
author | Brett Porter <brett@apache.org> | 2014-07-31 20:20:12 +1000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2014-07-31 20:22:27 +1000 |
commit | 1e589ddd62ec068e3797f351566ff62274a549ba (patch) | |
tree | 02310dd7496b5e77b612e9741eac122c52070044 /archiva-modules/plugins | |
parent | 12a808a77d72b9d07f56efe04a1908c1ff8c4b1b (diff) | |
download | archiva-1e589ddd62ec068e3797f351566ff62274a549ba.tar.gz archiva-1e589ddd62ec068e3797f351566ff62274a549ba.zip |
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
Diffstat (limited to 'archiva-modules/plugins')
-rw-r--r-- | archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java | 12 |
1 files 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(); } } |