Retrieving a Non-Pooled Session
By default, HST request processing uses pooled Java Content Repository (JCR) sessions. You can also obtain a non-pooled JCR session when needed. Non-pooled sessions are not managed by the HST resource lifecycle, so you must log out these sessions manually after use.
Obtain a Non-Pooling Repository
To retrieve a repository instance that does not use session pooling, use the following code:
Repository repository = HstServices .getComponentManager() .getComponent(Repository.class.getName() + ".delegating");
With this non-pooling repository instance, you can create a session as shown below:
Session mySession = repository.login(credentials);
The credentials parameter must not use any of the pooled credentials described in Retrieving a pooled session.
Important: Always call logout() on non-pooled sessions when you are finished. Non-pooled sessions are not automatically cleaned up by the HST framework.