Uploaded image for project: 'appNG'
  1. appNG
  2. APPNG-2297

OptimisticLockException on site reload after installing application with database

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Done
    • Affects Version/s: 1.18.0
    • Fix Version/s: 1.21.0
    • Component/s: appng-core
    • Labels:
      None

      Description

      This issue occured on appNG Cluser with MSSQL Database. An application with database connection has been attached to a site and the database connection has been created. The site reload on the first cluster node was successful but failed on the other node with a OptimisticLockException. After that, the site was not started and in a state that all further site reloads failed with a NullPointerException.

      I analyzed the issue. When the application is attached to the site, the database connection entry ist created and the status is "not active". On site reload, the database state is set to "active". This will change the version of the entry. The site reload event is sent before leaving the persistence context.

      The other node started the site reload and reads the database connection entry where the connection is still "not active". It changes the state to "active" in the meantime the row was updated by the fist node and an OptimisticLockException is thrown.

      This can also been reproduced by setting the status of an existing database connection manually (per SQL Query) to "not active" and doing a site reload.

        Attachments

          Activity

            People

            • Assignee:
              mueller.matthias Matthias Müller
              Reporter:
              stuemke.claus Claus Stuemke
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: