Jackrabbit Content Repository
  1. Jackrabbit Content Repository
  2. JCR-593

JCASessionHandle fail when i invoke logout method

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.0.1, 1.1
    • Fix Version/s: None
    • Component/s: jackrabbit-jca
    • Labels:
      None

      Description

      I think that the "logout method" (in JCASessionHandle) isn't totally correct. I consider that we must check, before closing session, if this session is binded to a transaction. In this situation the session mustn't be closed: transaction will close it.

      public void logout() {
      if (!mc.getManagedConnectionFactory().getBindSessionToTrasaction().booleanValue())

      { mc.closeHandle(this); }

      }

      For example this is very important when we use spring, springmodules (jcr module) and jackrabbit because the springmodules library closes session when local transaction finishes. And if the session is closed by transaction a exception is throwed.

      Thanks

        Activity

        Hide
        Edgar Poce added a comment -

        I think the jca project is not handling the close method properly because there shouldn't be a bind to transaction configuration option. The jca project should bind the jcr session to the transaction only if a logout call was made inside a transaction. WDYT?
        I'll prepare a patch asap.

        I don't think the proposed patch is a good fix. With the proposed patch if the client doesn't participate in a transaction when it tries to close the session the call will be ignored causing a session leak.

        In the current revision the jcr session is bound to the transaction lifecycle optionally. If the jcr module closes the session you can set the option to false and it should work fine for you.

        thanks

        Show
        Edgar Poce added a comment - I think the jca project is not handling the close method properly because there shouldn't be a bind to transaction configuration option. The jca project should bind the jcr session to the transaction only if a logout call was made inside a transaction. WDYT? I'll prepare a patch asap. I don't think the proposed patch is a good fix. With the proposed patch if the client doesn't participate in a transaction when it tries to close the session the call will be ignored causing a session leak. In the current revision the jcr session is bound to the transaction lifecycle optionally . If the jcr module closes the session you can set the option to false and it should work fine for you. thanks

          People

          • Assignee:
            Edgar Poce
            Reporter:
            Jorge Rodríguez Pedrianes
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development