Skip to content

Failing transaction rollback due to inactive transaction for failed sendNotifications

When NotificationService#sendNotifications fails and throws an exception, it is tried to rollback the transaction. However, in this context, there is no active transaction.

is it enough to remove the connection.rollback(); ?

} catch (Exception exc) {
     connection.rollback();
     log.warn("Unable to send notification [{}] to [{}]",
     notification.iri().stringValue(), meta.callbackUrl());
     log.debug("Exception while sending notification [{}] to [{}]", notification.iri().stringValue(), meta.callbackUrl(), exc);
}

https://git.openlogisticsfoundation.org/wg-digitalaircargo/ne-one/-/blob/bba8c3f87d6a7d6ace279d991cf7ed32530614b9/src/main/java/org/openlogisticsfoundation/neone/service/NotificationService.java#L171