Github user jburwell commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/768#discussion_r42860149
  
    --- Diff: framework/db/src/com/cloud/utils/db/Transaction.java ---
    @@ -59,4 +59,30 @@ public T doInTransaction(TransactionStatus status) 
throws RuntimeException {
             });
         }
     
    +    @SuppressWarnings("deprecation")
    +    public static <T, E extends Throwable> T execute(final short 
databaseId, TransactionCallbackWithException<T, E> callback) throws E {
    +        String name = "tx-" + counter.incrementAndGet();
    +        TransactionLegacy currentTxn = TransactionLegacy.currentTxn(false);
    +        short outer_txn_databaseId = (currentTxn != null ? 
currentTxn.getDatabaseId() : databaseId);
    +        TransactionLegacy txn = TransactionLegacy.open(name, databaseId, 
true);
    +        try {
    --- End diff --
    
    @abhinandanprateek I don't see how using Java7's try-with-resource feature 
would bleed quota code.  It's a standard Java7 feature that reduces user error 
and code. 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to