Skip to content
Snippets Groups Projects
Verified Commit 71590d03 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

fix problem with cached deleted entities

parent 9626bcf5
Branches
Tags
3 merge requests!21Release v0.4.0,!7F fsm,!6Draft: F acm permissions2
......@@ -45,6 +45,7 @@ import org.caosdb.server.datatype.ReferenceDatatype2;
import org.caosdb.server.datatype.ReferenceValue;
import org.caosdb.server.datatype.TextDatatype;
import org.caosdb.server.entity.ClientMessage;
import org.caosdb.server.entity.DeleteEntity;
import org.caosdb.server.entity.EntityInterface;
import org.caosdb.server.entity.Message;
import org.caosdb.server.entity.Message.MessageType;
......@@ -828,6 +829,9 @@ public abstract class EntityStateJob extends EntityJob {
private void putCache(String key, EntityInterface value) {
synchronized (cache) {
if(value instanceof DeleteEntity) {
throw new RuntimeException("Delete entity in cache. This is an implementation error.");
}
id_in_cache.add(value.getId());
cache.put(key, value);
}
......
......@@ -40,6 +40,7 @@ import org.caosdb.server.entity.WritableEntity;
import org.caosdb.server.entity.wrapper.Property;
import org.caosdb.server.jobs.JobAnnotation;
import org.caosdb.server.jobs.JobExecutionTime;
import org.caosdb.server.transaction.Delete;
import org.caosdb.server.transaction.WriteTransaction;
import org.caosdb.server.utils.EntityStatus;
import org.caosdb.server.utils.Observable;
......@@ -67,8 +68,11 @@ public class InitEntityStateJobs extends EntityStateJob implements Observer {
State newState = handleNewState();
State oldState = handleOldState(newState);
if (newState != null || oldState != null) {
if(!(getTransaction() instanceof Delete)) {
appendJob(MakeStateProperty.class);
}
appendJob(CheckStateTransition.class);
appendJob(MakeStateProperty.class);
appendJob(MakeStateMessage.class);
} else if (newState == null
&& getEntity().getRole() == Role.Record
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment