Uploaded image for project: 'Seam Persistence'
  1. Seam Persistence
  2. SEAMPERSIST-17

ManagedPersistenceContextProxyHandler.java not correctly handling "getProvider" method.

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.0.0.Beta2
    • Fix Version/s: None
    • Labels:
      None

      Description

      While trying to leverage Seam Managed Persistence Contexts as described in the associated seam-persistence reference documentation, I ran into an issue where the ManagedPersistenceContext::getProvider method is invoked in the PersistenceContextImpl class (line 131). The problem is that this method call when proxied with a ManagedPersistenceContextProxyHandler will currently result in an attempt to call the "getProvider" method on the delegated object (which in my case is an EntityManager instance). Obviously, the EntityManager interface does not define a method called "getProvider" and so I get an error.

      Looking into the problem, I believe the root issue is that the ManagedPersistenceContextProxyHandler::invoke method is expecting the supplied method name to be "getPersistenceProvider" rather than "getProvider" (see line 100). Moreover, the ManagedPersistenceContext class defines a "getProvider" method rather than a "getPersistenceProvider" method (suggesting that perhaps the name was refactored at some point in the past and ManagedPersistenceContextProxyHandler::invoke wasn't updated).

      If I modify the code on line 100 to use "getProvider" rather than "getPersistenceProvider", I'm able to load my SMPC properly in my application.

        Gliffy Diagrams

          Activity

          Hide
          swd847 Stuart Douglas added a comment -

          Thanks for the excellent description of the problem

          Show
          swd847 Stuart Douglas added a comment - Thanks for the excellent description of the problem

            People

            • Assignee:
              swd847 Stuart Douglas
              Reporter:
              dsampy2000 Derrick Ampy
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development