Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-5945

Attachment storage depends on undefined behavior in hibernate.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.0 M2
    • 3.0 M1
    • Storage
    • None
    • Unknown

    Description

      When an attachment is saved, the metadata is saved before the content.
      A transaction is opened, session.update() is called on the attachment metadata, then the attachment content is saved. When the content is saved, the latest version is added to the archive. When the latest version is added to the archive, the attachment version number and date on the attachment are changed. this alters the metadata and this altered metadata must be saved.

      Hibernate does not actually send any UPDATE statements to the database until commit() is called and it saves the objects in whatever state they are in when commit is called. This is arguably a bug and unless someone has documentation on this behavior, it must be regarded as unreliable.

      Attachments

        Activity

          People

            calebjamesdelisle CalebJamesDeLisle
            calebjamesdelisle CalebJamesDeLisle
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: