I wonder if problem is here: [deleting variant metrics followed by delete of push message metrics|https://github.com/aerogear/aerogear-unifiedpush-server/blob/1.1.0-beta.4/model/jpa/src/main/java/org/jboss/aerogear/unifiedpush/jpa/dao/impl/JPAPushMessageInformationDao.java#L115-L121]
{code} delete from VariantMetricInformation vmi where vmi.pushMessageInformation.id in (select pmi FROM PushMessageInformation pmi WHERE pmi.submitDate < :oldest) ; delete FROM PushMessageInformation pmi WHERE pmi.submitDate < :oldest; {code}
It seems that variant informations should be actually [deleted in cascade|https://github.com/aerogear/aerogear-unifiedpush-server/blob/1.1.0-beta.4/model/jpa/src/main/resources/org/jboss/aerogear/unifiedpush/api/PushMessageInformation.hbm.xml#L43]:
So at the end simpler delete would be needed:
{code} delete FROM PushMessageInformation pmi WHERE pmi.submitDate < :oldest {code}
|