Changed the way JCR sessions are created and destroyed.