try {
state = module.beforeCommit(filteredTransactionData);
} catch (NeedsInitializationException e) {
LOG.warn("Module " + module.getId() + " seems to have a problem and will be re-initialized next time the database is started. ");
TxDrivenModuleMetadata moduleMetadata = metadataRepository.getModuleMetadata(module);
metadataRepository.persistModuleMetadata(module, moduleMetadata.markedNeedingInitialization());
} catch (DeliberateTransactionRollbackException e) {
LOG.debug("Module " + module.getId() + " threw an exception indicating that the transaction should be rolled back.", e);
result.put(module.getId(), state); //just so the module gets afterRollback called as well
afterRollback(result); //remove this when https://github.com/neo4j/neo4j/issues/2660 is resolved