Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6908717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:35:55+00:00 2026-05-27T08:35:55+00:00

This guide JCR Wiki proposes the use of a new session for each request.

  • 0

This guide JCR Wiki proposes the use of a new session for each request. My task is to create a tree of jackrabbit files. So going by this guide to get properties/ nodes of each item, I would need to create new session and close it later? This way I would create a lot of sessions every time, which looks strange.

But if I use one session for all time for JCR I have problem with MemoryHeapException in JCR side and not right saved nodes sometimes.

Are there any norms towards an approach between using one session and creating a session every time? Or am I misreading the guide?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:35:55+00:00Added an answer on May 27, 2026 at 8:35 am

    I’m more familiar with ModeShape than Jackrabbit, but in general I think it’s best practice to create a new session for each request, use that session to process the request, and then close the session.

    Generally, sessions are pretty lightweight and inexpensive to create. But there are some reasons why creating separate sessions is better (or at least easier):

    1. javax.jcr.Session is not thread-safe, so if you’re going to use a Session to handle multiple requests, you have to be sure that a Session is only being used in processing one request at a time. In other words, you’d some sort of pool of Sessions objects.
    2. Session is stateful, so any information loaded by one session might be kept until the Session is refreshed or closed.
    3. Session is for a specific user. If each incoming request might be associated with different users, you may be leaking privileges and data.

    There may be other reasons I’m not thinking of, but regardless I hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this guide to create a HTTPHandler that combines script and css files
I'm following this guide: http://www.math.umd.edu/~dcarrera/ruby/0.3/chp_01/programs.html and I'm trying to create my first ruby program.
I followed this guide: http://wiki.unto.net/setting-up-clojure-and-slime Which walked me through the steps of building Clojure
Recently I started taking this guide to get myself started on downloading files from
I am new to rails and read this guide to get all the info
I've been following this guide in order to create tabs on my web application.
I am using this guide to use Django 'out-of-box' with Google App Engine using
I am trying to create a Nuget package from my project following this guide
I've been following this guide for the HandleError attribute: blogs.msdn.com which I use like
I'm trying to follow this guide on a new WSS 3.0 install on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.