private void addStoreRememberTx(StoreAndRememberContext cxt, String storeVerifyTxUID) {
    for (String sopInstanceUID : cxt.getInstances()) {
      StoreAndRemember sr = new StoreAndRemember();
      sr.setTransactionUID(cxt.getTransactionUID());
      sr.setStoreVerifyTransactionUID(storeVerifyTxUID);
      sr.setStatus(StoreAndRememberStatus.PENDING);
      sr.setLocalAE(cxt.getLocalAE());
      sr.setRemoteAE(cxt.getRemoteAE());
      sr.setExternalDeviceName(cxt.getExternalDeviceName());
      sr.setStoreVerifyProtocol(cxt.getStoreVerifyProtocol().toString());
      sr.setRetriesLeft(cxt.getRetries());
      sr.setDelay(cxt.getDelay());

      sr.setSopInstanceUID(sopInstanceUID);
      sr.setInstanceStatus(StoreVerifyStatus.PENDING);
      em.persist(sr);
    }
  }
 public void createOrUpdateStoreRememberTx(StoreAndRememberContext cxt, String storeVerifyTxUID) {
   if (!updateStoreVerifyUIDOfStoreRemembers(cxt.getTransactionUID(), storeVerifyTxUID)) {
     addStoreRememberTx(cxt, storeVerifyTxUID);
   }
 }