diff --git a/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ByteArrayManager.java b/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ByteArrayManager.java
index 8e26cd9934..2799b0edaa 100644
--- a/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ByteArrayManager.java
+++ b/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ByteArrayManager.java
@@ -16,15 +16,15 @@
  */
 package org.camunda.bpm.engine.impl.persistence.entity;
 
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
 import org.camunda.bpm.engine.impl.db.ListQueryParameterObject;
 import org.camunda.bpm.engine.impl.db.entitymanager.operation.DbOperation;
 import org.camunda.bpm.engine.impl.persistence.AbstractManager;
 import org.camunda.bpm.engine.impl.util.ClockUtil;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
 /**
  * @author Joram Barrez
  */
@@ -60,7 +60,17 @@ public class ByteArrayManager extends AbstractManager {
     parameters.put("removalTime", removalTime);
 
     getDbEntityManager()
-      .updatePreserveOrder(ByteArrayEntity.class, "updateByteArraysByProcessInstanceId", parameters);
+      .updatePreserveOrder(ByteArrayEntity.class, "updateVariableByteArraysByProcessInstanceId", parameters);
+    getDbEntityManager()
+      .updatePreserveOrder(ByteArrayEntity.class, "updateDecisionInputsByteArraysByProcessInstanceId", parameters);
+    getDbEntityManager()
+      .updatePreserveOrder(ByteArrayEntity.class, "updateDecisionOutputsByteArraysByProcessInstanceId", parameters);
+    getDbEntityManager()
+      .updatePreserveOrder(ByteArrayEntity.class, "updateJobLogByteArraysByProcessInstanceId", parameters);
+    getDbEntityManager()
+      .updatePreserveOrder(ByteArrayEntity.class, "updateExternalTaskLogByteArraysByProcessInstanceId", parameters);
+    getDbEntityManager()
+      .updatePreserveOrder(ByteArrayEntity.class, "updateAttachmentByteArraysByProcessInstanceId", parameters);
   }
 
   public DbOperation deleteByteArraysByRemovalTime(Date removalTime, int minuteFrom, int minuteTo, int batchSize) {
diff --git a/engine/src/main/resources/org/camunda/bpm/engine/impl/mapping/entity/VariableInstance.xml b/engine/src/main/resources/org/camunda/bpm/engine/impl/mapping/entity/VariableInstance.xml
index 56a53ecd0d..7274c38d2b 100644
--- a/engine/src/main/resources/org/camunda/bpm/engine/impl/mapping/entity/VariableInstance.xml
+++ b/engine/src/main/resources/org/camunda/bpm/engine/impl/mapping/entity/VariableInstance.xml
@@ -487,7 +487,7 @@
       where ROOT_PROC_INST_ID_ = #{rootProcessInstanceId, jdbcType=VARCHAR}
   </update>
 
-  <update id="updateByteArraysByProcessInstanceId"
+  <update id="updateVariableByteArraysByProcessInstanceId"
           parameterType="java.util.Map">
     update ${prefix}ACT_GE_BYTEARRAY
       set REMOVAL_TIME_ = #{removalTime, jdbcType=TIMESTAMP}
@@ -496,31 +496,66 @@
         SELECT BYTEARRAY_ID_
         FROM ${prefix}ACT_HI_VARINST
         WHERE PROC_INST_ID_ = #{processInstanceId, jdbcType=VARCHAR}
-      ) or ID_ IN (
+      )
+  </update>
+
+  <update id="updateDecisionInputsByteArraysByProcessInstanceId"
+          parameterType="java.util.Map">
+    update ${prefix}ACT_GE_BYTEARRAY
+      set REMOVAL_TIME_ = #{removalTime, jdbcType=TIMESTAMP}
+      where ID_ IN (
         <!-- decision inputs -->
         SELECT BYTEARRAY_ID_
         FROM ${prefix}ACT_HI_DEC_IN I
         INNER JOIN ${prefix}ACT_HI_DECINST D
         ON I.DEC_INST_ID_ = D.ID_
         WHERE D.PROC_INST_ID_ = #{processInstanceId, jdbcType=VARCHAR}
-      ) or ID_ IN (
+      )
+  </update>
+
+  <update id="updateDecisionOutputsByteArraysByProcessInstanceId"
+          parameterType="java.util.Map">
+    update ${prefix}ACT_GE_BYTEARRAY
+      set REMOVAL_TIME_ = #{removalTime, jdbcType=TIMESTAMP}
+      where ID_ IN (
         <!-- decision outputs -->
         SELECT BYTEARRAY_ID_
         FROM ${prefix}ACT_HI_DEC_OUT O
         INNER JOIN ${prefix}ACT_HI_DECINST D
         ON O.DEC_INST_ID_ = D.ID_
         WHERE D.PROC_INST_ID_ = #{processInstanceId, jdbcType=VARCHAR}
-      ) or ID_ IN (
+      )
+  </update>
+
+  <update id="updateJobLogByteArraysByProcessInstanceId"
+          parameterType="java.util.Map">
+    update ${prefix}ACT_GE_BYTEARRAY
+      set REMOVAL_TIME_ = #{removalTime, jdbcType=TIMESTAMP}
+      where ID_ IN (
         <!-- job log -->
         SELECT JOB_EXCEPTION_STACK_ID_
         FROM ${prefix}ACT_HI_JOB_LOG
         WHERE PROCESS_INSTANCE_ID_ = #{processInstanceId, jdbcType=VARCHAR}
-      ) or ID_ IN (
+      )
+  </update>
+
+  <update id="updateExternalTaskLogByteArraysByProcessInstanceId"
+          parameterType="java.util.Map">
+    update ${prefix}ACT_GE_BYTEARRAY
+      set REMOVAL_TIME_ = #{removalTime, jdbcType=TIMESTAMP}
+      where ID_ IN (
         <!-- external task log -->
         SELECT ERROR_DETAILS_ID_
         FROM ${prefix}ACT_HI_EXT_TASK_LOG
         WHERE PROC_INST_ID_ = #{processInstanceId, jdbcType=VARCHAR}
-      ) or ID_ IN (
+      )
+  </update>
+
+  <update id="updateAttachmentByteArraysByProcessInstanceId"
+          parameterType="java.util.Map">
+    update ${prefix}ACT_GE_BYTEARRAY
+      set REMOVAL_TIME_ = #{removalTime, jdbcType=TIMESTAMP}
+      where ID_ IN (
         <!-- attachment -->
         SELECT CONTENT_ID_
         FROM ${prefix}ACT_HI_ATTACHMENT A
