Fix logic that was failing to cache results on cache miss.
This commit is contained in:
parent
e932d0dcf2
commit
1eccb631f3
4 changed files with 7 additions and 16 deletions
|
@ -22,8 +22,7 @@ import java.util.Map;
|
|||
import net.helenus.core.*;
|
||||
import net.helenus.mapping.HelenusProperty;
|
||||
|
||||
public abstract class AbstractFilterStreamOperation<
|
||||
E, O extends AbstractFilterStreamOperation<E, O>>
|
||||
public abstract class AbstractFilterStreamOperation<E, O extends AbstractFilterStreamOperation<E, O>>
|
||||
extends AbstractStreamOperation<E, O> {
|
||||
|
||||
protected Map<HelenusProperty, Filter<?>> filters = null;
|
||||
|
|
|
@ -164,16 +164,12 @@ public abstract class AbstractOptionalOperation<E, O extends AbstractOptionalOpe
|
|||
SerializationUtils.<Serializable>clone(
|
||||
(Serializable) cachedResult));
|
||||
}
|
||||
updateCache = false;
|
||||
sessionCacheHits.mark();
|
||||
cacheHits.mark();
|
||||
uow.recordCacheAndDatabaseOperationCount(1, 0);
|
||||
if (result.isPresent()) {
|
||||
} else {
|
||||
updateCache = true;
|
||||
} else {
|
||||
updateCache = false;
|
||||
}
|
||||
} else {
|
||||
updateCache = false;
|
||||
sessionCacheMiss.mark();
|
||||
cacheMiss.mark();
|
||||
uow.recordCacheAndDatabaseOperationCount(-1, 0);
|
||||
|
@ -184,9 +180,9 @@ public abstract class AbstractOptionalOperation<E, O extends AbstractOptionalOpe
|
|||
}
|
||||
} else {
|
||||
//TODO(gburd): look in statement cache for results
|
||||
updateCache = false; //true;
|
||||
cacheMiss.mark();
|
||||
uow.recordCacheAndDatabaseOperationCount(-1, 0);
|
||||
updateCache = false; //true;
|
||||
}
|
||||
} else {
|
||||
updateCache = false;
|
||||
|
|
|
@ -168,17 +168,13 @@ public abstract class AbstractStreamOperation<E, O extends AbstractStreamOperati
|
|||
result =
|
||||
(E) SerializationUtils.<Serializable>clone((Serializable) cachedResult);
|
||||
}
|
||||
updateCache = false;
|
||||
resultStream = Stream.of(result);
|
||||
sessionCacheHits.mark();
|
||||
cacheHits.mark();
|
||||
uow.recordCacheAndDatabaseOperationCount(1, 0);
|
||||
if (result != null) {
|
||||
} else {
|
||||
updateCache = true;
|
||||
} else {
|
||||
updateCache = false;
|
||||
}
|
||||
} else {
|
||||
updateCache = false;
|
||||
sessionCacheMiss.mark();
|
||||
cacheMiss.mark();
|
||||
uow.recordCacheAndDatabaseOperationCount(-1, 0);
|
||||
|
|
|
@ -61,7 +61,7 @@ public @interface Column {
|
|||
boolean forceQuote() default false;
|
||||
|
||||
/**
|
||||
* Used to determin if updates can be retried. Also, mutations to this field do not trigger
|
||||
* Used to determine if updates can be retried. Also, mutations to this field do not trigger
|
||||
* objects in the session cache to be evicted.
|
||||
*
|
||||
* @return
|
||||
|
|
Loading…
Reference in a new issue