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

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

    Details

      Description

      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                hchiorean Horia Chiorean
                Reporter:
                hchiorean Horia Chiorean
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: