Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-17736

ObjectStore transaction handling can be simplified

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 3.0.0
    • None
    • Hive
    • None

    Description

      There are many places in ObjectStore that do something like this:

          boolean commited = false;
         try {
            openTransaction();
            commited = commitTransaction();
          } finally {
            if (!commited) {
              rollbackTransaction();
            }
          }
      

      We can simplify this in two ways:

      1) Create a wrapper that calls given piece of code inside the block of code above. This is similar to TransactionManager in Sentry.

      2) Create a special auto-closeable object that does the check and rollback on close.

      Attachments

        1. HIVE-17736.01.patch
          62 kB
          Alex Kolbasov

        Activity

          People

            Unassigned Unassigned
            akolb Alex Kolbasov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: