cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sw...@apache.org
Subject [1/3] git commit: updated refs/heads/master to 06c6b36
Date Fri, 13 May 2016 21:05:22 GMT
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 <m@brothier.org>
Authored: Wed May 4 14:28:44 2016 +0200
Committer: Marc-Aurèle Brothier <m@brothier.org>
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<T, ID extends Serializable>
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


Mime
View raw message