brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #331: Fix some memory leaks and better memory u...
Date Tue, 27 Sep 2016 07:05:46 GMT
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/331#discussion_r80630775
  
    --- Diff: camp/camp-base/src/main/java/org/apache/brooklyn/camp/spi/pdp/AssemblyTemplateConstructor.java
---
    @@ -40,15 +40,22 @@ public AssemblyTemplateConstructor(CampPlatform campPlatform) {
             this.transaction = this.campPlatform.transaction();
         }
         
    -    /** records all the templates to the underlying platform */
    +    /** records all the templates to the underlying platform 
    +     * @deprecated since 0.10.0 use {@link #construct(boolean)} */
         public AssemblyTemplate commit() {
    +        return construct(true);
    +    }
    +    
    +    /** builds the template, optionally recording everything to the underlying platform
*/
    +    public AssemblyTemplate construct(boolean save) {
             checkState();
             AssemblyTemplate at = builder.build();
    -        transaction.add(at).commit();
    +        if (!save) transaction.clear();
    +        transaction.commit();
             transaction = null;
             return at;
         }
    -
    +    
    --- End diff --
    
    Can you just not call commit/construct (for the lack of rollback) and let the objects
GC instead of doing the API changes in `camp-base`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message