private void unlockTransaction(){
    LinkedList<TransactionalLock> annotations = s_transactionalLocks.get();
    if (annotations.isEmpty()) {
      return;
    }

    // iterate through all locks which were encountered during the course of
    // this transaction and release them all now that the transaction is
    // committed; iterate reverse to unlock the most recently locked areas
    Iterator<TransactionalLock> iterator = annotations.descendingIterator();
    while (iterator.hasNext()) {
      TransactionalLock annotation = iterator.next();
      LockArea lockArea = annotation.lockArea();
      LockType lockType = annotation.lockType();

      ReadWriteLock rwLock = transactionLocks.getLock(lockArea);
      Lock lock = lockType == LockType.READ ? rwLock.readLock() : rwLock.writeLock();

      lock.unlock();
      iterator.remove();
    }
  }
Unlocks all {@link LockArea}s associated with this transaction or any of
the child transactions which were joined. The order that the locks are
released is inverted from the order in which they were acquired.
ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptor.java