Compare with

Comparison of OpenJPA with MySQL server vs EclipseLink with H2 server

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
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
Basic Person Test0.152.62.11.61.12.1
Element Collection Testfailed1.41.30.951.31.2
Inheritance Test0.152.52.21.61.22.1
Indexing Test0.23 3.0 1.6 
Graph (Binary Tree) Testfailed1.0failed1.2failed1.1
Multithreading Testfailed3.15.37.95.35.5
All Tests0.182.12.82.71.82.4

OpenJPA with MySQL server has failed in 4 tests (see exceptions).

The results above show that in general EclipseLink with H2 server is more efficient than OpenJPA with MySQL server in persisting JPA entity objects to the database.

A huge performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of OpenJPA with MySQL database server (0.15) to the normalized speed of EclipseLink with H2 database server (2.6) reveals that in that case, EclipseLink with H2 server is 17.3 times faster than OpenJPA with MySQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
Basic Person Testfailed4.219.612.419.68.3
Element Collection Testfailed0.00211.2stopped1.20.0021
Inheritance Testfailed4.217.111.417.17.8
Indexing Testfailed 19.2 19.2 
Graph (Binary Tree) Testfailed0.58failed0.58failed0.58
Multithreading Testfailed11.332.429.432.420.3
All Testsfailed4.117.913.517.98.2

OpenJPA with MySQL server has failed in 7 tests (see exceptions).

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
Basic Person Testfailed1.12.70.472.70.79
Element Collection Testfailed0.761.3stopped1.30.76
Inheritance Testfailed1.11.20.481.20.78
Indexing Testfailed 5.6 5.6 
Multithreading Testfailed0.34failed1.8failed1.0
All Testsfailed0.822.70.902.70.86

OpenJPA with MySQL server has failed in 6 tests (see exceptions).

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
Basic Person Teststopped3.03.42.33.42.7
Element Collection Testfailed0.00661.6stopped1.60.0066
Inheritance Testfailed1.01.41.01.41.0
Indexing Testfailed 3.8 3.8 
Graph (Binary Tree) Testfailed0.52failed0.45failed0.48
Multithreading Testfailed3.88.97.48.95.6
All Tests0.00001.73.82.83.82.2

OpenJPA with MySQL server has failed in 6 tests (see exceptions).

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
Basic Person Teststopped2.41.91.41.91.9
Element Collection Testfailed0.00200.61stopped0.610.0020
Inheritance Testfailed2.52.01.52.02.0
Indexing Testfailed 2.6 2.6 
Graph (Binary Tree) Testfailedfailedfailedfailedfailedfailed
Multithreading Testfailed4.67.15.37.14.9
All Tests0.00002.42.82.72.82.5

OpenJPA with MySQL server has failed in 6 tests (see exceptions). EclipseLink with H2 server has failed in 2 tests (see exceptions).

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
OpenJPA
MySQL server
EclipseLink
H2 server
Basic Person Test0.152.76.03.65.03.2
Element Collection Testfailed0.441.20.951.20.52
Inheritance Test0.152.34.83.24.02.7
Indexing Test0.23 6.8 5.7 
Graph (Binary Tree) Testfailed0.71failed0.73failed0.72
Multithreading Testfailed4.613.410.413.47.5
All Tests0.182.36.14.75.53.4

The results above show that in general OpenJPA with MySQL server is more efficient than EclipseLink with H2 server in performing JPA database operations.

On the other hand, OpenJPA with MySQL server is slower, for instance, when using simple basic entities with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with MySQL database server (0.15) to the normalized speed of EclipseLink with H2 database server (2.7) reveals that in that case, OpenJPA with MySQL server is 18.0 times slower than EclipseLink with H2 server.

Other Head to Head DBMS/JPA Comparisons