Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-10308

Single-datasource mode to work without XA

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.7.1
    • Component/s: Core, Core VCS, Directory
    • Impact type:
      Deployment change
    • Upgrade notes:
      Hide

      To activate single-datasource mode (which is the default since Nuxeo 5.7.1), define the variable:

      nuxeo.db.singleDataSource=jdbc/NuxeoDS

      By default this is defined from templates/common-base/nuxeo.defaults.

      To disable it (which you MUST DO if you use several repositories), just use:

          nuxeo.db.singleDataSource=

      The datasource name can of course be different than jdbc/NuxeoDS, but it must be a valid datasource already defined elsewhere.

      In addition, the maximum pool size for the datasource must be enough for all the VCS connections, which means that you must have

      nuxeo.db.max-pool-size ≥ nuxeo.vcs.max-pool-size + 2

      (The + 2 comes from two reserved connections for the VCS lock manager and the cluster node handler.)

      As an advanced feature, if you want single-datasource mode except for some specific datasources (that need to hit a separate database for instance), then you can use:

      nuxeo.db.singleDataSource.exclude=jdbc/mydatasource, jdbc/otherdatasource

      NOTE HOWEVER that these datasources will not participate in any global XA transaction so there will be no two-phase commit for them and on error and rollback (which should not happen) they may become inconsistent.

      Non-standard code wishing to use this feature should use the ConnectionHelper.getConnection() API.

      Show
      To activate single-datasource mode (which is the default since Nuxeo 5.7.1), define the variable: nuxeo.db.singleDataSource=jdbc/NuxeoDS By default this is defined from templates/common-base/nuxeo.defaults. To disable it (which you MUST DO if you use several repositories), just use:     nuxeo.db.singleDataSource= The datasource name can of course be different than jdbc/NuxeoDS, but it must be a valid datasource already defined elsewhere. In addition, the maximum pool size for the datasource must be enough for all the VCS connections, which means that you must have nuxeo.db.max-pool-size ≥ nuxeo.vcs.max-pool-size + 2 (The + 2 comes from two reserved connections for the VCS lock manager and the cluster node handler.) As an advanced feature, if you want single-datasource mode except for some specific datasources (that need to hit a separate database for instance), then you can use: nuxeo.db.singleDataSource.exclude=jdbc/mydatasource, jdbc/otherdatasource NOTE HOWEVER that these datasources will not participate in any global XA transaction so there will be no two-phase commit for them and on error and rollback (which should not happen) they may become inconsistent. Non-standard code wishing to use this feature should use the ConnectionHelper.getConnection() API.

      Description

      Using XA has costs:

      • slower in general, as coordination is required between resources,
      • much slower on Oracle RAC,
      • not available on SQL Server (simulated using jTDS),
      • not available at all on Azure.

      Change Nuxeo to be able to work in a mode where, in a given thread, only one database connection is used for all resources (VCS, directories, hibernate). This allows for a secure rollback.

      Symptoms of the Oracle RAC problems may be errors like:

      ORA-02049: timeout: distributed transaction waiting for lock
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.