@Override
@Produces
public RepositoryConnection getConnection() throws RepositoryException {
restartLock.readLock().lock();
RepositoryConnection connection = repository.getConnection();
return new RepositoryConnectionWrapper(repository,connection) {
@Override
public void close() throws RepositoryException {
super.close();
restartLock.readLock().unlock();
}