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
This commit is contained in:
Brett Porter 2014-07-31 20:20:12 +10:00
parent 12a808a77d
commit 1e589ddd62
1 changed files with 2 additions and 10 deletions

View File

@ -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();
}
}