diff --git a/pom.xml b/pom.xml
index 0669e3b..f30e432 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
4.0.0
net.helenus
helenus-core
- 2.0.28-SNAPSHOT
+ 2.0.29-SNAPSHOT
jar
helenus
diff --git a/src/main/java/net/helenus/core/operation/AbstractOptionalOperation.java b/src/main/java/net/helenus/core/operation/AbstractOptionalOperation.java
index c374f62..ba99e2a 100644
--- a/src/main/java/net/helenus/core/operation/AbstractOptionalOperation.java
+++ b/src/main/java/net/helenus/core/operation/AbstractOptionalOperation.java
@@ -74,18 +74,19 @@ public abstract class AbstractOptionalOperation result = null;
String key = getStatementCacheKey();
- if (key != null) {
+ if (enableCache && key != null) {
Set cachedResult = (Set) uow.cacheLookup(key);
if (cachedResult != null) {
//TODO(gburd): what about select ResultSet, Tuple... etc.?
uowCacheHits.mark();
logger.info("UOW({}) cache hit, {} -> {}", uow.hashCode(), key, cachedResult.toString());
result = cachedResult.stream().findFirst();
+ } else {
+ uowCacheMiss.mark();
}
}
if (result == null) {
- uowCacheMiss.mark();
ResultSet resultSet = execute(sessionOps, uow, traceContext, showValues, true);
result = transform(resultSet);
diff --git a/src/main/java/net/helenus/core/operation/AbstractStatementOperation.java b/src/main/java/net/helenus/core/operation/AbstractStatementOperation.java
index ea40f87..19a0682 100644
--- a/src/main/java/net/helenus/core/operation/AbstractStatementOperation.java
+++ b/src/main/java/net/helenus/core/operation/AbstractStatementOperation.java
@@ -38,6 +38,7 @@ public abstract class AbstractStatementOperation result = null;
String key = getStatementCacheKey();
- if (key != null) {
+ if (enableCache && key != null) {
Set cachedResult = (Set) uow.cacheLookup(key);
if (cachedResult != null) {
//TODO(gburd): what about select ResultSet, Tuple... etc.?
uowCacheHits.mark();
logger.info("UOW({}) cache hit, {} -> {}", uow.hashCode(), key, cachedResult.toString());
result = cachedResult.stream();
+ } else {
+ uowCacheMiss.mark();
}
}
if (result == null) {
- uowCacheMiss.mark();
ResultSet resultSet = execute(sessionOps, uow, traceContext, showValues, true);
result = transform(resultSet);
diff --git a/src/main/java/net/helenus/core/operation/SelectOperation.java b/src/main/java/net/helenus/core/operation/SelectOperation.java
index 2040997..358eb2f 100644
--- a/src/main/java/net/helenus/core/operation/SelectOperation.java
+++ b/src/main/java/net/helenus/core/operation/SelectOperation.java
@@ -48,7 +48,6 @@ public final class SelectOperation extends AbstractFilterStreamOperation ordering = null;
protected Integer limit = null;
protected boolean allowFiltering = false;
- protected boolean cacheEntity = false;
public SelectOperation(AbstractSessionOperations sessionOperations) {
super(sessionOperations);
@@ -77,8 +76,6 @@ public final class SelectOperation extends AbstractFilterStreamOperation extends AbstractFilterStreamOperation extends AbstractFilterStreamOperation ignoreCache() {
- cacheEntity = false;
- return this;
- }
-
public SelectOperation limit(Integer limit) {
this.limit = limit;
return this;