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

Transaction partially committed when database encoding differs from the java encoding

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Major
    • None
    • 1.1 RC2
    • Storage
    • None
    • latin1 mysql, utf8 xwiki 1.2 pre-M1

    Description

      I had an UTF8 instance of XWiki running on an mysql database. Since the default database encoding was latin1, I manually converted all the tables to UTF8, but when upgrading to the 1.2 trunk, the schema autoupdate created two new tables, xwikircs and xwikirecyclebin, but using the default latin1 encoding.

      After that, when saving a document with non-ascii characters, I got an error saying that \x90\x60 is not a valid value for the field patch, although the document was properly saved and could be retrieved from the database. After that, when trying to save that document again, I kept getting a NullPointerException at the XWikiRcsNodeInfo.setDiff method. At first, I thought that there's a bug in the new document history code, by not setting that field. After a closer look at the database, I discovered that several fields of the corresponding xwikircs row were NULL. Now I could not save that document, as the history couldn't be loaded, and I couldn't delete the document for the same reason.

      The only solution was to delete those rows, update the table to the right encoding, and then resave the document.

      As far as I know, a transaction is defined as an atomic operation, either all the operations are successfully performed, or none of the operations are performed. Why did only part of the transaction make it to the database? Does it always work like that with hibernate?

      Attachments

        Activity

          People

            sdumitriu Sergiu Dumitriu
            sdumitriu Sergiu Dumitriu
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: