Thursday, September 27, 2018

HikariCP pooling

If you are going to crate connections pools you have many options:


Why shoud I HikariCP? It's just very fast and stable!














Let's create configuration with Spring boot:

And our database configuration property

Our Persisntence Configuration

Ah I know  packagesToScan is ugly. We have Lambdas in Java. Generally this method is craeted to scan components in different modules.

public List <String> packagesToScan() { 
   return scanPackages.stream()
            .map(ScanPersistencePackage::asStrings)
            .flatMap(Collection::stream)
            .collect(Collectors.toList());
}
And concrete persistence configuration for our module:

No comments:

Post a Comment