Skip to content

Check for JCR session handling #1

@joerghoh

Description

@joerghoh

A check should be available, which makes sure, that every JCR session, which is opened locally in a method, is finally closed.

So the structure should be something like this:

Session mySession;
try {
  mySession = ....

} finally {
  if (mySession.isLive()) {
    mySession.close();
  }
}

So as precondition to the check:

  • a local variable of type "javax.jcr.Session

the check itself:

  • the variable is set inside a try-finally block.
  • in the finally-block there is above shown pattern for closing the session.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions