Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2678

ModeShape's database binary store uses DB connections in auto-commit mode


    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 5.4.0.Final
    • 5.3.0.Final, 4.6.2.Final
    • Storage, Transactions
    • None

      ModeShape's DatabaseBinaryStore uses database connections in auto-commit mode for all of its operations. While this might work in practice for operations which involve a single query for example, it's likely that this is not a good approach for operations which write to the DB.

      For example, when storing a new binary value, the storeValue method performs a number of database calls, including operations like searching for an existing value and doing something if that value does not exist.

      Since binaries are not necessarily created inside of transactions (the default binaryValueFactory.createBinary is almost always called outside of a transaction unless user transactions are employed), the code should never rely in all cases on auto-commit mode.

      This is one possible explanation for the exception from the attached forum issue, where multiple cluster writers are simultaneously attempting to insert the same binary.

            hchiorean Horia Chiorean (Inactive)
            hchiorean Horia Chiorean (Inactive)
            0 Vote for this issue
            1 Start watching this issue