Tuning applications that use the Java Persistence API
Subtopics
JPA system properties
In addition to the settings that are accessible from the administrative console, you can set Java Persistence API (JPA) system properties by using command-line scripting.Configuring heterogeneous SQL statement batching
Heterogeneous SQL statement batching is an improvement over the org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager. This functionality can improve the performance of your JPA application because it allows multiple different SQL statements to be sent to the database in a single batch. For example, if you have a transaction that updates one Entity and also inserts another Entity, when you use the BatchingConstraintUpdateManager function, two different batches are sent to the database: one for the update and another for the insert. In the same scenario, if you use the HeteroConstraintUpdateManager function, only one batch, which contains both operations, is sent to the database.Configuring WSJPA ObjectCache to improve performance
The WebSphere® Java™ Persistence API (WSJPA) extension to OpenJPA provides a read-only object cache that can improve performance in certain use cases. This configuration is only supported when you use WSJPA at the JPA 2.0 specification level.Pre-loading the WSJPA ObjectCache automatically
The WebSphere Java Persistence API (WSJPA) extension to OpenJPA provides a read-only ObjectCache that can improve performance in certain use cases. By default, the data in the cache is loaded in a lazy method, which means that individual entities are loaded into memory when they are requested by an application. If you want to load all the entities from the beginning, though, you can configure the application server to preload all of the entities from the database that are configured in the ObjectCache. Pre-loading the ObjectCache will allow you to cache entities that would otherwise be restricted when if you load the ObjectCache through the lazy method. This configuration is only supported when you use WSJPA at the JPA 2.0 specification level.JPA system properties
In addition to the settings that are accessible from the administrative console, you can set Java Persistence API (JPA) system properties by using command-line scripting.Configuring heterogeneous SQL statement batching
Heterogeneous SQL statement batching is an improvement over the org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager. This functionality can improve the performance of your JPA application because it allows multiple different SQL statements to be sent to the database in a single batch. For example, if you have a transaction that updates one Entity and also inserts another Entity, when you use the BatchingConstraintUpdateManager function, two different batches are sent to the database: one for the update and another for the insert. In the same scenario, if you use the HeteroConstraintUpdateManager function, only one batch, which contains both operations, is sent to the database.Configuring WSJPA ObjectCache to improve performance
The WebSphere Java Persistence API (WSJPA) extension to OpenJPA provides a read-only object cache that can improve performance in certain use cases. This configuration is only supported when you use WSJPA at the JPA 2.0 specification level.Pre-loading the WSJPA ObjectCache automatically
The WebSphere Java Persistence API (WSJPA) extension to OpenJPA provides a read-only ObjectCache that can improve performance in certain use cases. By default, the data in the cache is loaded in a lazy method, which means that individual entities are loaded into memory when they are requested by an application. If you want to load all the entities from the beginning, though, you can configure the application server to preload all of the entities from the database that are configured in the ObjectCache. Pre-loading the ObjectCache will allow you to cache entities that would otherwise be restricted when if you load the ObjectCache through the lazy method. This configuration is only supported when you use WSJPA at the JPA 2.0 specification level.


File name: container_jpa_tuning.html