code: public void removeEventWaitForActivityInstance(Long activityInstanceId, String reason) throws SQLException {
          String query = "delete from EVENT_WAIT_INSTANCE where EVENT_WAIT_INSTANCE_OWNER_ID=?";
          db.runUpdate(query, activityInstanceId);
          this.recordEventHistory("All Events", EventLog.SUBCAT_DEREGISTER,
                  OwnerType.ACTIVITY_INSTANCE, activityInstanceId, reason);
          if (db.isMySQL())  //Commit since JMS message to resume activity was already sent, in case next activity to notify causes deadlock
              db.commit();
      }
docs: remove other wait instances when an activity receives one event