Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-2020

Using one Ofbiz instance with multiple databases

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • Trunk
    • Trunk
    • None
    • None

    Description

      I want to share my work with you implementing the use of one OFBiz instance with multiple databases, by defining multiple delegators, in the entityengine.xml, one for each databases. this is useful when we implementing ofbiz for semi-independent subsidiaries of one company having users allowed to use two or more databases.
      This involve mainly the user authentication procedure by asking for a company name in the login form. This company name represents a delegator name that describe a specific subsidiary database. After a successful user login operation, the passed company name is used to retrieve the corresponding delegator. The method CoreEvents.chageDelegator is modified to change the delegator of related Dispatcher and JobManager.
      Of course I needed to store the delegator name in the GenericValue UserLogin to navigate among different ofbiz applications keeping the same original database.
      I also provided a kind of mechanism to activate or deactivates the use of multi-delegator by adding a "multi.delegator" property in the security.properties configuration file that when set true, cause the ofbiz to display he company field in the login form and do the necessary work to switch from default database to the provided one.
      I will be open to discuss any suggestion for improving this issue.
      Following is a patch for current ofbiz trunk version:

      Attachments

        1. ofbiz-multi.patch
          27 kB
          youssef khaye
        2. entitymodel.xml.rej
          0.5 kB
          Jacques Le Roux
        3. ofbiz-multi.patch
          24 kB
          Jacques Le Roux
        4. ofbiz-multi.patch
          28 kB
          youssef khaye

        Activity

          People

            Unassigned Unassigned
            lyoussef youssef khaye
            Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: