Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-9857

PersonalInformation (userinfo) fetching assumes a uniqueness constraint that isn't enforced

XMLWordPrintable

      NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      The following errors can occur in the logs after two threads attempt to access and then successfully create a single User's User Info (aka userinfo, PersonalInformation, personal information)

      2007-10-28 02:15:29,871 ERROR [TP-Processor3] [com.atlassian.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object when single object requested: [userinfo: testuser1 v.1 (15763661), userinfo: testuser1 v.1 (15763669)]
      

      The HibernatePersonalInformationDao has a getByUsername method that calls the findSingleObject method which selects the single PersonalInformation object

      from Content info
      where info.originalVersion is null and
      info.username = ?
      

      Unfortunately, there is little enforcement that there is only one PersonalInformation for each user with a null version. There is only high level code that checks the Object can't be fetched from the database before creating the object and sending it to the persistence layer. It's not even synchronized, so this bug isn't confined to clustered instances.

      It's occurrence is still quite improbable. It does require two separate threads to require the user's PersonalInformation at approximately the same time, but it can and does happen and it should be stopped. The obvious solution is to add a uniquenesss constraint to the PersonalInformation subclass definition in ContentEntityObject.hbm.xml on the (Username, Version) attribute pair. Note that the username is only used for PersonalInformation objects.

              mtran@atlassian.com Minh Tran
              don.willis@atlassian.com Don Willis
              Votes:
              24 Vote for this issue
              Watchers:
              44 Start watching this issue

                Created:
                Updated:
                Resolved: