Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1BE1B200828 for ; Fri, 13 May 2016 23:05:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1A6CD160A16; Fri, 13 May 2016 21:05:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 69F181602BE for ; Fri, 13 May 2016 23:05:23 +0200 (CEST) Received: (qmail 65464 invoked by uid 500); 13 May 2016 21:05:22 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 65451 invoked by uid 99); 13 May 2016 21:05:22 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 May 2016 21:05:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 78DAADFC6C; Fri, 13 May 2016 21:05:22 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: swill@apache.org To: commits@cloudstack.apache.org Date: Fri, 13 May 2016 21:05:22 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/3] git commit: updated refs/heads/master to 06c6b36 archived-at: Fri, 13 May 2016 21:05:24 -0000 Repository: cloudstack Updated Branches: refs/heads/master f2f895a5c -> 06c6b367e dao: Hit the cache for entity flagged as removed too since they are put in cache afterwards. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/696440a6 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/696440a6 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/696440a6 Branch: refs/heads/master Commit: 696440a6754a60888fce7a82e8022ca7278b9be5 Parents: 5251eed Author: Marc-Aurèle Brothier Authored: Wed May 4 14:28:44 2016 +0200 Committer: Marc-Aurèle Brothier Committed: Wed May 4 14:38:11 2016 +0200 ---------------------------------------------------------------------- framework/db/src/com/cloud/utils/db/GenericDaoBase.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/696440a6/framework/db/src/com/cloud/utils/db/GenericDaoBase.java ---------------------------------------------------------------------- diff --git a/framework/db/src/com/cloud/utils/db/GenericDaoBase.java b/framework/db/src/com/cloud/utils/db/GenericDaoBase.java index 29adbe2..2de161b 100644 --- a/framework/db/src/com/cloud/utils/db/GenericDaoBase.java +++ b/framework/db/src/com/cloud/utils/db/GenericDaoBase.java @@ -969,7 +969,12 @@ public abstract class GenericDaoBase extends Compone @Override @DB() public T findByIdIncludingRemoved(ID id) { - return findById(id, true, null); + if (_cache != null) { + final Element element = _cache.get(id); + return element == null ? findById(id, true, null) : (T)element.getObjectValue(); + } else { + return findById(id, true, null); + } } @Override