Hi,
I want to use oak in my project as embedded.For a start I wrote a test method. 
In my method I use the same code from this example here 
https://jackrabbit.apache.org/oak/docs/construct.htmlThe code runs just fine 
but it does not terminate unless I shutdown repository:((RepositoryImpl) 
repo).shutdown();So in my project, not for the first time but ever time when I 
want to connect to repository I call 
                        mongoClient = new MongoClient(host, port);              
        DB db = mongoClient.getDB(dbName);                                      
        Builder builder = new DocumentMK.Builder();                     
builder.setMongoDB(db);                 ns = builder.getNodeStore();            
                                Oak oak = new Oak(ns);                  Jcr jcr 
= new Jcr(oak);                                         repo = 
jcr.createRepository();                                          try {          
                                                 session = repo.login(new 
SimpleCredentials("admin", "admin".toCharArray()));                    }        
               catch (LoginException e) {                                       
                       throw new 
EntityEngineException(ExceptionCode.OAK_LOGIN_ERROR, null, e, 
JackrabbitOakSession.class);                    }                       catch 
(RepositoryException e) {                                                       
  throw new EntityEngineException(ExceptionCode.OAK_REPOSITORY_ERROR, null, e, 
JackrabbitOakSession.class);                       };
and in the end
              session.logout();              ((RepositoryImpl) 
repo).shutdown();              ns.dispose();              mongoClient.close();

So:1. Do I have to call createRepository() every time or just for the first 
time and then use another method to connect repository.2. Is shuting down the 
repository needed?                                      

Reply via email to