Hypersistence Optimizer is a dynamic analyzing tool that can scan your JPA and Hibernate application and provide you tips about the changes you need to make to entity mappings, configurations, queries, and Persistence Context actions to speed up your data access layer.
Once you downloaded the Full or Trial version, you need to follow a series of steps in order to install Hypersistence Optimizer.
The first thing you need to do is to unzip the package you have just downloaded.
> unzip hypersistence-optimizer-2.14.1-pack.zipAfter unzipping the project package, you will get the following file structure:
creating: hypersistence-optimizer-2.14.1/
creating: hypersistence-optimizer-2.14.1/lib/
inflating: hypersistence-optimizer-2.14.1/lib/hypersistence-optimizer-2.14.1-javadoc.jar
inflating: hypersistence-optimizer-2.14.1/lib/hypersistence-optimizer-2.14.1-sources.jar
inflating: hypersistence-optimizer-2.14.1/lib/hypersistence-optimizer-2.14.1.jar
creating: hypersistence-optimizer-2.14.1/docs/
creating: hypersistence-optimizer-2.14.1/docs/html/
creating: hypersistence-optimizer-2.14.1/docs/pdf/
inflating: hypersistence-optimizer-2.14.1/docs/html/asciidoctor.css
inflating: hypersistence-optimizer-2.14.1/docs/html/coderay-asciidoctor.css
inflating: hypersistence-optimizer-2.14.1/docs/pdf/InstallationGuide.pdf
inflating: hypersistence-optimizer-2.14.1/docs/html/InstallationGuide.html
inflating: hypersistence-optimizer-2.14.1/docs/html/UserGuide.html
inflating: hypersistence-optimizer-2.14.1/docs/pdf/UserGuide.pdf
inflating: hypersistence-optimizer-2.14.1/changelog.txt
inflating: hypersistence-optimizer-2.14.1/LICENSE.txt
inflating: hypersistence-optimizer-2.14.1/maven-install.bat
inflating: hypersistence-optimizer-2.14.1/maven-install.sh
inflating: hypersistence-optimizer-2.14.1/README.txtThe package contains the following resources:
- the
libfolder contains the mainjarfile, as well as the JavaDoc and the Java sources - the
docsfolder contains the Installation and User Guides - the
changelogfile contains the release notes for all product versions - the
LICENSEfile contains the project license info - the
maven-installscripts allow you to install the Java artifacts in your local Maven repository - the
READMEfile contains a short description of the project
In order to install Hypersistence Optimizer, you need to read the Installation Guide, which is available both in HTML and PDF formats in the unzipped package:
hypersistence-optimizer-2.14.1/docs/pdf/InstallationGuide.pdfhypersistence-optimizer-2.14.1/docs/html/InstallationGuide.html
You can also read the Installation Guide online if you want.
After you are done with the Installation Guide, you should read the User Guide too, as it shows how you can configure Hypersistence Optimizer so that you can get the most out of it.
You can find the User Guide in the docs folder as well:
hypersistence-optimizer-2.14.1/docs/html/UserGuide.htmlhypersistence-optimizer-2.14.1/docs/pdf/UserGuide.pdf
You can also read the User Guide online if you want.
This repository contains examples for Spring Boot, Spring Framework, Java EE that can help you set up the tool.
By default, this repository is configured for the Full version.
If you want to use it with the Trial version, you should use the trial branch instead:
> git checkout trialYou should check out the entire repository since the child modules use the versions defined in the parent module
pom.xml.
There are multiple modules in this repository:
hypersistence-optimizer-test-casehypersistence-optimizer-config-examplehypersistence-optimizer-spring-hibernate-examplehypersistence-optimizer-spring-hibernate4-examplehypersistence-optimizer-spring-hibernate3-examplehypersistence-optimizer-spring-jpa-examplehypersistence-optimizer-spring-jpa-hibernate4-examplehypersistence-optimizer-spring-jpa-hibernate3-examplehypersistence-optimizer-spring-boot-examplehypersistence-optimizer-spring-boot-jta-examplehypersistence-optimizer-spring-boot3-examplehypersistence-optimizer-spring-boot3-hibernate7-examplehypersistence-optimizer-glassfish-hibernate-examplehypersistence-optimizer-glassfish-hibernate4-examplehypersistence-optimizer-jboss-eap7-hibernate5-examplehypersistence-optimizer-quarkus-spring-examplehypersistence-optimizer-quarkus-examplehypersistence-optimizer-micronaut-examplehypersistence-optimizer-micronaut2-example
This module provides a test case template you could use to replicate a certain Hypersistence Optimizer issue.
This module shows various examples of how you can configure Hypersistence Optimizer.
It also shows the checks added in Hypersistence Optimizer 2.15:
AsyncMetadataScannersTestruns the mapping and configuration scanners in the background, so they don't delay the application bootstrap.HibernateConfigurationChecksTestdetects the Hibernate 6 and 7 settings that affect performance, like a disabled query plan cache.MySQLJdbcDriverChecksTestdetects the MySQL JDBC Driver settings that add extra database roundtrips, and the missing socket timeout.PostgreSQLJdbcDriverChecksTestdetects the missing socket timeout and the default application name of the PostgreSQL JDBC Driver.MySQLResultSetStreamingTestdetects a streamed query whose result set the MySQL JDBC Driver loads entirely into memory.PostgreSQLAutoExplainTestdetects that the PostgreSQLauto_explainmodule, which logs the actual execution plans of the slow queries, is not enabled.PostgreSQLSchemaChecksTestreads the database catalog, and detects a table without a Primary Key and an unindexed Foreign Key column.DatabaseScannerDisabledTestshows how to disable the database scanner.
This module shows how you can use Hypersistence Optimizer with Spring Boot.
This module shows how you can use Hypersistence Optimizer with Spring Boot 3.
The tests in the io.hypersistence.optimizer.forum.pool package run the application on MySQL with every connection pool
that Spring Boot supports (HikariCP, Tomcat JDBC, DBCP2, Oracle UCP, and c3p0), and check that Hypersistence Optimizer
detects the pool settings that let the MySQL server close the idle connections before the pool retires them.
This module shows how you can use Hypersistence Optimizer with Spring and the JPA LocalEntityManagerFactoryBean.
This module shows how you can use Hypersistence Optimizer with Spring, the JPA LocalEntityManagerFactoryBean, and Hibernate 4.
This module shows how you can use Hypersistence Optimizer with Spring, the JPA LocalEntityManagerFactoryBean, and Hibernate 3.
This module shows how you can use Hypersistence Optimizer with Spring and the Hibernate LocalSessionFactoryBean.
This module shows how you can use Hypersistence Optimizer with Spring and the Hibernate 4 LocalSessionFactoryBean.
This module shows how you can use Hypersistence Optimizer with Spring and the Hibernate 3 LocalSessionFactoryBean.
This module shows how you can use Hypersistence Optimizer with Java EE and GlassFish.
This module shows how you can use Hypersistence Optimizer with Java EE, GlassFish, and Hibernate 4.
This module shows how you can use Hypersistence Optimizer on JBoss EAP 7.4 (Java EE 8, Java 8) with its own Hibernate 5.3, through
the JPA subsystem, with EJBs, a local-tx and an XA PostgreSQL DataSource, JMS, an Infinispan second-level cache cluster, and a
Hibernate monitor that links every SQL statement and Hypersistence Optimizer event to the transaction that caused it. The
Arquillian tests need Docker, and run with test-arquillian.bat from the module folder. See the module
README for details.
This module shows how you can use Hypersistence Optimizer with Quarkus's Spring based extensions.
This module shows how you can use Hypersistence Optimizer with Quarkus (Hibernate Panache ORM).
The tests in the io.hypersistence.optimizer.forum.pool package run the application on MySQL, and check that Hypersistence Optimizer
detects the Agroal connection pool settings.
All modules work with Java 8 or newer versions, and the project is set up using Maven.
While most tests use the in-memory HSQLDB, some tests use MySQL or PostgreSQL, and, for this reason, you need to configure
the database connection properties in the MySQLDataSourceProvider and PostgreSQLDataSourceProvider classes.
By default, the project expects that you are using the following MySQL database connection properties:
- Database: high_performance_java_persistence
- Port: 3306
- UserName: mysql
- Password: admin
For PostgreSQL, the project expects the high_performance_java_persistence database on port 5432, with the postgres user and the admin password.
You can also use docker-compose to run the MySQL and PostgreSQL servers using the command:
docker-compose up
To run the tests, you can use:
mvn clean test
If you'd like to create a new issue, be it a feature request or simply reporting a bug, then you can use this GitHub repository issue list.
For bugs, it would be awesome if you provided a replicating test case as well. You can use the EagerFetchingManyToOneTest as a template to create your new test case scenario.
When you are done, please send your test case as a Pull Request, and I'll take care of it.
Thank you for using Hypersistence Optimizer and stay tuned for more!