OpenJPA
  1. OpenJPA
  2. OPENJPA-1551

Allow connectionFactoryName to be specified when creating an EntityManager

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-beta3
    • Component/s: jpa
    • Labels:
      None

      Description

      Some application utilize the same table definitions across a several schemas or separate database instances to isolate customer data.

      A pure JPA solution to this problem would be to create a separate EntityManagerFactory for each schema & database instance. This approach scales poorly, and results in a lot of duplicate processing time, and memory used.

      As an alternative we could provide the ability to specify the connectionFactory to use when the EntityManager is created. Effectively this allows the EntityManagers to share a MetaDataRepository but communicate with different databases.

      There are some limitations to this support, obviously the table definitions must be identical for each database used, if the OR mappings include a schema that schema must exist (and be writeable) in each database come to mind, but in the long run for applications which follow this specific pattern this function could be a large benefit.

      1. mylyn-context.zip
        76 kB
        Michael Dick

        Issue Links

          Activity

          Michael Dick created issue -
          Hide
          Michael Dick added a comment -

          Attaching mylyn context in case it's of interest.

          Show
          Michael Dick added a comment - Attaching mylyn context in case it's of interest.
          Michael Dick made changes -
          Field Original Value New Value
          Attachment mylyn-context.zip [ 12438022 ]
          Michael Dick made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Donald Woods made changes -
          Fix Version/s 2.0.0-beta3 [ 12314857 ]
          Fix Version/s 2.0.0 [ 12314019 ]
          Donald Woods made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Michael Dick made changes -
          Link This issue is related to OPENJPA-1742 [ OPENJPA-1742 ]
          Michael Dick made changes -
          Link This issue is related to OPENJPA-1749 [ OPENJPA-1749 ]

            People

            • Assignee:
              Michael Dick
              Reporter:
              Michael Dick
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development