Compare with

Comparison of OpenJPA with H2 server vs Hibernate with SQLite embedded

Each of the following tables focuses on a specific database operation, where the last table presents average results comparison.

Speed comparison of JPA database persistence operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
Hibernate
SQLite embedded
OpenJPA
H2 server
Hibernate
SQLite embedded
OpenJPA
H2 server
Hibernate
SQLite embedded
Basic Person Test3.70.0832.21.02.90.55
Element Collection Test2.60.0671.50.692.10.38
Inheritance Test4.50.0802.00.993.20.54
Indexing Test7.30.0983.61.05.40.55
Graph (Binary Tree) Test1.10.270.840.960.970.61
Multithreading Test7.7failed4.2failed5.9failed
All Tests4.50.122.40.933.40.53

Hibernate with SQLite embedded has failed in 2 tests (see exceptions).

The results above show that in general OpenJPA with H2 server is much more efficient than Hibernate with SQLite embedded in persisting JPA entity objects to the database. Comparing the normalized speed of Hibernate with SQLite embedded database (0.53) to the normalized speed of OpenJPA with H2 database server (3.4) reveals that in these tests, OpenJPA with H2 server is 6.4 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using database indexes with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.098) to the normalized speed of OpenJPA with H2 database server (7.3) reveals that in that case, OpenJPA with H2 server is 74.5 times faster than Hibernate with SQLite embedded.

Speed comparison of JPA database retrieval operations (normalized score, higher is better)

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
Hibernate
SQLite embedded
OpenJPA
H2 server
Hibernate
SQLite embedded
OpenJPA
H2 server
Hibernate
SQLite embedded
Basic Person Test2.91.87.61.35.21.5
Element Collection Test0.00220.00081.9failed0.930.0008
Inheritance Test0.0132.44.01.42.01.9
Indexing Test4.11.98.82.36.52.1
Graph (Binary Tree) Test0.380.560.490.880.440.72
Multithreading Test5.9failed14.0failed10.0failed
All Tests2.21.36.11.54.21.4

Hibernate with SQLite embedded has failed in 3 tests (see exceptions).

The results above show that in general OpenJPA with H2 server is much more efficient than Hibernate with SQLite embedded in retrieving JPA entity objects from the database. Comparing the normalized speed of Hibernate with SQLite embedded database (1.4) to the normalized speed of OpenJPA with H2 database server (4.2) reveals that in these tests, OpenJPA with H2 server is 3.0 times faster than Hibernate with SQLite embedded.

A large performance gap has been detected when using simple basic entities with large retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (1.3) to the normalized speed of OpenJPA with H2 database server (7.6) reveals that in that case, OpenJPA with H2 server is 5.8 times faster than Hibernate with SQLite embedded.

On the other hand, OpenJPA with H2 server is slower, for instance, when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of OpenJPA with H2 database server (0.013) to the normalized speed of Hibernate with SQLite embedded database (2.4) reveals that in that case, OpenJPA with H2 server is 185 times slower than Hibernate with SQLite embedded.

Speed comparison of JPA database query operations (normalized score, higher is better)

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
Hibernate
SQLite embedded
OpenJPA
H2 server
Hibernate
SQLite embedded
OpenJPA
H2 server
Hibernate
SQLite embedded
Basic Person Test3.71.11.00.222.40.65
Element Collection Test2.00.391.2failed1.60.39
Inheritance Test2.80.531.10.282.00.40
Indexing Test3.80.00117.50.435.70.21
Multithreading Test0.98failed1.0failed1.0failed
All Tests2.70.502.40.312.50.42

Hibernate with SQLite embedded has failed in 3 tests (see exceptions).

The results above show that in general OpenJPA with H2 server is much more efficient than Hibernate with SQLite embedded in executing the tested JPA queries. Comparing the normalized speed of Hibernate with SQLite embedded database (0.42) to the normalized speed of OpenJPA with H2 database server (2.5) reveals that in these tests, OpenJPA with H2 server is 6.0 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.0011) to the normalized speed of OpenJPA with H2 database server (3.8) reveals that in that case, OpenJPA with H2 server is 3,455 times faster than Hibernate with SQLite embedded.

Speed comparison of JPA database update operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
Hibernate
SQLite embedded
OpenJPA
H2 server
Hibernate
SQLite embedded
OpenJPA
H2 server
Hibernate
SQLite embedded
Basic Person Test3.00.0762.00.652.50.37
Element Collection Test0.00780.00221.9failed0.940.0022
Inheritance Test0.0340.0792.80.971.40.53
Indexing Test2.80.0573.20.543.00.30
Graph (Binary Tree) Test0.790.260.430.420.610.34
Multithreading Test7.0failed2.5failed4.8failed
All Tests2.30.0942.10.652.20.34

Hibernate with SQLite embedded has failed in 3 tests (see exceptions).

The results above show that in general OpenJPA with H2 server is much more efficient than Hibernate with SQLite embedded in updating JPA entity objects in the database. Comparing the normalized speed of Hibernate with SQLite embedded database (0.34) to the normalized speed of OpenJPA with H2 database server (2.2) reveals that in these tests, OpenJPA with H2 server is 6.5 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using database indexes with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.057) to the normalized speed of OpenJPA with H2 database server (2.8) reveals that in that case, OpenJPA with H2 server is 49.1 times faster than Hibernate with SQLite embedded.

On the other hand, OpenJPA with H2 server is slower, for instance, when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with H2 database server (0.034) to the normalized speed of Hibernate with SQLite embedded database (0.079) reveals that in that case, OpenJPA with H2 server is 2.3 times slower than Hibernate with SQLite embedded.

Speed comparison of JPA database removal operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
Hibernate
SQLite embedded
OpenJPA
H2 server
Hibernate
SQLite embedded
OpenJPA
H2 server
Hibernate
SQLite embedded
Basic Person Test3.20.0612.20.912.70.49
Element Collection Test0.00600.00070.88failed0.440.0007
Inheritance Test0.0300.0583.10.901.60.48
Indexing Test6.50.0793.60.545.10.31
Graph (Binary Tree) Test0.730.240.750.800.740.52
Multithreading Test7.6failed5.2failed6.4failed
All Tests3.00.0882.60.792.80.40

Hibernate with SQLite embedded has failed in 3 tests (see exceptions).

The results above show that in general OpenJPA with H2 server is much more efficient than Hibernate with SQLite embedded in deleting JPA entity objects from the database. Comparing the normalized speed of Hibernate with SQLite embedded database (0.40) to the normalized speed of OpenJPA with H2 database server (2.8) reveals that in these tests, OpenJPA with H2 server is 7.0 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using database indexes with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.079) to the normalized speed of OpenJPA with H2 database server (6.5) reveals that in that case, OpenJPA with H2 server is 82.3 times faster than Hibernate with SQLite embedded.

Comparison of JPA/Database speed - the averages (normalized score, higher is better)

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
Hibernate
SQLite embedded
OpenJPA
H2 server
Hibernate
SQLite embedded
OpenJPA
H2 server
Hibernate
SQLite embedded
Basic Person Test3.30.633.00.813.10.72
Element Collection Test0.930.0921.50.691.20.19
Inheritance Test1.50.632.60.912.00.77
Indexing Test4.90.425.40.965.10.69
Graph (Binary Tree) Test0.750.330.630.770.690.55
Multithreading Test5.9failed5.4failed5.6failed
All Tests2.90.423.20.863.00.62

The results above show that in general OpenJPA with H2 server is much more efficient than Hibernate with SQLite embedded in performing JPA database operations. Comparing the normalized speed of Hibernate with SQLite embedded database (0.62) to the normalized speed of OpenJPA with H2 database server (3.0) reveals that in these tests, OpenJPA with H2 server is 4.8 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using database indexes with small transaction/retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.42) to the normalized speed of OpenJPA with H2 database server (4.9) reveals that in that case, OpenJPA with H2 server is 11.7 times faster than Hibernate with SQLite embedded.

Other Head to Head DBMS/JPA Comparisons