Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-14046

Refactor code that breaks transaction chaining

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.0.0
    • 2.2.0
    • ambari-server
    • None

    Description

      Pattern issue:

         @Transactional
      -  private void unmapHostClusterEntities(String hostName, long clusterId) {
      +  void unmapHostClusterEntities(String hostName, long clusterId) {
           HostEntity hostEntity = hostDAO.findByName(hostName);
      

      Transaction chaining allow graceful rollback as well as affects visibility of changes to entity objects in a DB session.

      Presently a lot of chained methods have private access with @Transactional annotation which means the MethodInterceptor which provides the chaining functionality will not work and the intermediate DAO calls will persist.

      Attachments

        Issue Links

          Activity

            People

              mpapirkovskyy Papirkovskyy Myroslav
              mpapirkovskyy Papirkovskyy Myroslav
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: