Spring Data JPA
  1. Spring Data JPA
  2. DATAJPA-138

MergingPersistenceUnitManager doesnt work with Spring 3.1.0 DefaultPersistenceUnitManager

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.1
    • Fix Version/s: 1.0.3, 1.1 RC1
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Spring ORM 3.1.0.RELEASE

      Description

      The following check in DefaultPersistenceUnitManager of Spring ORM 3.1.0.RELEASE defeats the purpose of the merge using the same persistence unit name:

      String name = pui.getPersistenceUnitName();
      if (!this.persistenceUnitInfoNames.add(name)) {
      	StringBuilder msg = new StringBuilder();
      	msg.append("Conflicting persistence unit definitions for name '").append(name).append("': ");
      	msg.append(pui.getPersistenceUnitRootUrl()).append(", ");
      	msg.append(this.persistenceUnitInfos.get(name).getPersistenceUnitRootUrl());
      	throw new IllegalStateException(msg.toString());
      }
      

        Issue Links

          Activity

          Hide
          Oliver Gierke added a comment -

          It seems we're suffering from this code being introduced quite a while ago. I've opened up a ticket against Spring to see what we can do about it.

          Show
          Oliver Gierke added a comment - It seems we're suffering from this code being introduced quite a while ago. I've opened up a ticket against Spring to see what we can do about it.
          Hide
          Oliver Gierke added a comment -

          Jürgen has introduced a protected calback method coming in Spring 3.1.1 that allows working around the restriction. I have altered the implementation of MergingPersistenceUnitManager accordingly so that it will now work with Spring 3.0.x and >= 3.1.1. Backported into 1.0.x branch.

          Show
          Oliver Gierke added a comment - Jürgen has introduced a protected calback method coming in Spring 3.1.1 that allows working around the restriction. I have altered the implementation of MergingPersistenceUnitManager accordingly so that it will now work with Spring 3.0.x and >= 3.1.1. Backported into 1.0.x branch.

            People

            • Assignee:
              Oliver Gierke
              Reporter:
              Christian Oldiges
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: