Created
May 28, 2018 06:03
-
-
Save sohlich/980e3740f4b8bbff851bb20a93e62731 to your computer and use it in GitHub Desktop.
spring - hook on transaction commit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter(){ | |
public void afterCommit(){ | |
List<Ontology> markets = ontologyRepository.findAll(dtoList | |
.stream() | |
.map(MarketDTO::getMarketId) | |
.collect(Collectors.toList())); | |
log.info("Indexing markets after deferral configuration: {}",markets.size()); | |
ontologyIndexRepository.indexList(markets); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment