Choose benchmark test, operation and batch mode:

When one or more of the All filters is selected - only average normalized results are displayed. Please read Running and Results for more details.

Speed comparison of JPA database query operations per second (higher is better)

 Derby
embedded
H2
embedded
HSQLDB
embedded
SQLite
embedded
DB4O
embedded
ObjectDB
embedded
Derby
server
H2
server
MySQL
server
PostgreSQL
server
ObjectDB
server
DataNucleus13.72.50.87 failed 6.62.34.08.6 
EclipseLink25.12.61.6failed  9.72.10.8114.2 
Hibernate12.42.11.60.40  7.51.93.711.0 
OpenJPA18.02.01.6   10.01.94.1failed 
ObjectDB     182    47.1

Performance comparison chart - The Y-Axis represents normalized score in logarithmic scale - higher is better:
JPA performance benchmark comparision Hibernate, EclipseLink, OpenJPA, DataNucleus, ObjectDB

Performance comparison chart - The Y-Axis represents normalized score in linear scale - higher is better:
JPA performance benchmark comparision Hibernate, EclipseLink, OpenJPA, DataNucleus, ObjectDB

Best and Worst JPA/Database Performer in this comparison

The Most Efficient (the Fastest):

1. ObjectDB embedded100
2. ObjectDB server25.9
3. EclipseLink with Derby embedded13.8
4. OpenJPA with Derby embedded9.9
5. EclipseLink with PostgreSQL server7.8
6. DataNucleus with Derby embedded7.5
7. Hibernate with Derby embedded6.8
8. Hibernate with PostgreSQL server6.1
9. OpenJPA with Derby server5.5
10. EclipseLink with Derby server5.3
11. DataNucleus with PostgreSQL server4.7
12. Hibernate with Derby server4.1
13. DataNucleus with Derby server3.6
14. OpenJPA with MySQL server2.2
15. DataNucleus with MySQL server2.2
16. Hibernate with MySQL server2.0
17. EclipseLink with H2 embedded1.4

The Least Efficient (the Slowest):

18. DataNucleus with H2 embedded1.4
19. DataNucleus with H2 server1.3
20. Hibernate with H2 embedded1.2
21. EclipseLink with H2 server1.1
22. OpenJPA with H2 embedded1.1
23. OpenJPA with H2 server1.0
24. Hibernate with H2 server1.0
25. OpenJPA with HSQLDB embedded0.91
26. Hibernate with HSQLDB embedded0.88
27. EclipseLink with HSQLDB embedded0.88
28. DataNucleus with HSQLDB embedded0.48
29. EclipseLink with MySQL server0.44
30. Hibernate with SQLite embedded0.22
31. DataNucleus with DB4O embedded0.0000
32. EclipseLink with SQLite embedded0.0000
33. OpenJPA with PostgreSQL server0.0000

Problems (Exceptions) in these tests

  • EclipseLink with SQLite embedded
    Local Exception Stack: 
    Exception [EclipseLink-3002] (Eclipse Persistence Services - 2.1.1.v20100817-r8050): org.eclipse.persistence.exceptions.ConversionException
    Exception Description: The object [-1,130,400,000], of class [class java.lang.Integer], from mapping [org.eclipse.persistence.mappings.DirectToFieldMapping[birthDate-->PERSON.BIRTHDATE]] with descriptor [RelationalDescriptor(org.jpab.basic.Person --> [DatabaseTable(PERSON)])], could not be converted to [class java.util.Date].
    	at org.eclipse.persistence.exceptions.ConversionException.couldNotBeConverted(ConversionException.java:71)
    	at org.eclipse.persistence.internal.helper.ConversionManager.convertObjectToUtilDate(ConversionManager.java:761)
    	at org.eclipse.persistence.internal.helper.ConversionManager.convertObject(ConversionManager.java:101)
    	at org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.convertObject(DatasourcePlatform.java:157)
    	at org.eclipse.persistence.mappings.converters.TypeConversionConverter.convertDataValueToObjectValue(TypeConversionConverter.java:119)
    	at org.eclipse.persistence.mappings.foundation.AbstractDirectMapping.getAttributeValue(AbstractDirectMapping.java:675)
    	at org.eclipse.persistence.mappings.foundation.AbstractDirectMapping.valueFromRow(AbstractDirectMapping.java:1263)
    	at org.eclipse.persistence.mappings.foundation.AbstractDirectMapping.buildCloneFromRow(AbstractDirectMapping.java:1234)
    	at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildAttributesIntoWorkingCopyClone(ObjectBuilder.java:1338)
    	at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildWorkingCopyCloneFromRow(ObjectBuilder.java:1466)
    	at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObjectInUnitOfWork(ObjectBuilder.java:558)
    	at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:502)
    	at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:454)
    	at org.eclipse.persistence.queries.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:721)
    	at org.eclipse.persistence.queries.ReadAllQuery.registerResultInUnitOfWork(ReadAllQuery.java:723)
    	at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:420)
    	at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1074)
    	at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:736)
    	at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1034)
    	at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:380)
    	at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1112)
    	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2909)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1291)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1273)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1247)
    	at org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:479)
    	at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultList(EJBQueryImpl.java:714)
    	at org.jpab.Test.query(Test.java:315)
    	at org.jpab.Runner$QueryAction.run0(Runner.java:562)
    	at org.jpab.Runner$TestAction.run(Runner.java:517)
    	at java.lang.Thread.run(Thread.java:662)
    
  • DataNucleus with DB4O embedded
    javax.persistence.PersistenceException: Compiled filter contains method "matches" which is not currently supported by SODA queries
    	at org.datanucleus.api.jpa.NucleusJPAHelper.getJPAExceptionForNucleusException(NucleusJPAHelper.java:325)
    	at org.datanucleus.api.jpa.JPAQuery.getResultList(JPAQuery.java:202)
    	at org.jpab.Test.query(Test.java:315)
    	at org.jpab.Runner$QueryAction.run0(Runner.java:562)
    	at org.jpab.Runner$TestAction.run(Runner.java:517)
    	at java.lang.Thread.run(Thread.java:662)
    Caused by: org.datanucleus.exceptions.NucleusException: Compiled filter contains method "matches" which is not currently supported by SODA queries
    	at org.datanucleus.store.db4o.query.QueryToSODAMapper.processInvokeExpression(QueryToSODAMapper.java:576)
    	at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compilePrimaryExpression(AbstractExpressionEvaluator.java:200)
    	at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileUnaryExpression(AbstractExpressionEvaluator.java:169)
    	at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileAdditiveMultiplicativeExpression(AbstractExpressionEvaluator.java:148)
    	at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileRelationalExpression(AbstractExpressionEvaluator.java:123)
    	at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileOrAndExpression(AbstractExpressionEvaluator.java:65)
    	at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.evaluate(AbstractExpressionEvaluator.java:46)
    	at org.datanucleus.query.expression.Expression.evaluate(Expression.java:335)
    	at org.datanucleus.store.db4o.query.QueryToSODAMapper.compile(QueryToSODAMapper.java:95)
    	at org.datanucleus.store.db4o.query.JPQLQuery.createSODAQuery(JPQLQuery.java:215)
    	at org.datanucleus.store.db4o.query.JPQLQuery.performExecute(JPQLQuery.java:115)
    	at org.datanucleus.store.query.Query.executeQuery(Query.java:1791)
    	at org.datanucleus.store.query.Query.executeWithMap(Query.java:1694)
    	at org.datanucleus.api.jpa.JPAQuery.getResultList(JPAQuery.java:185)
    	... 4 more
    
  • OpenJPA with PostgreSQL server
     org.apache.openjpa.persistence.PersistenceException: ERROR: invalid escape string
      Hint: Escape string must be empty or one character. {prepstmnt 1836307068 SELECT t0.id, t0.birthDate, t0.city, t0.country, t0.email, t0.firstName, t0.joinDate, t0.lastLoginDate, t0.lastName, t0.loginCount, t0.middleName, t0.phone, t0.state, t0.street, t0.zip FROM Person t0 WHERE (t0.lastName LIKE ? ESCAPE '\\') [params=?]} [code=0, state=22025]
    FailedObject: SELECT o FROM Person o WHERE o.lastName LIKE :pattern [java.lang.String]
    	at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4871)
    	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4831)
    	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136)
    	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:118)
    	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:70)
    	at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.handleCheckedException(SelectResultObjectProvider.java:155)
    	at org.apache.openjpa.lib.rop.EagerResultList.(EagerResultList.java:40)
    	at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1251)
    	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1007)
    	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:863)
    	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:794)
    	at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542)
    	at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:315)
    	at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:331)
    	at org.jpab.Test.query(Test.java:315)
    	at org.jpab.Runner$QueryAction.run0(Runner.java:562)
    	at org.jpab.Runner$TestAction.run(Runner.java:517)
    	at java.lang.Thread.run(Thread.java:662)
    Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ERROR: invalid escape string
      Hint: Escape string must be empty or one character. {prepstmnt 1836307068 SELECT t0.id, t0.birthDate, t0.city, t0.country, t0.email, t0.firstName, t0.joinDate, t0.lastLoginDate, t0.lastName, t0.loginCount, t0.middleName, t0.phone, t0.state, t0.street, t0.zip FROM Person t0 WHERE (t0.lastName LIKE ? ESCAPE '\\') [params=?]} [code=0, state=22025]
    	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:281)
    	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:265)
    	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(LoggingConnectionDecorator.java:72)
    	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1183)
    	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:284)
    	at org.apache.openjpa.jdbc.sql.PostgresDictionary$PostgresPreparedStatement.executeQuery(PostgresDictionary.java:1012)
    	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:284)
    	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1783)
    	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:274)
    	at org.apache.openjpa.jdbc.sql.SelectImpl.executeQuery(SelectImpl.java:499)
    	at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:424)
    	at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:391)
    	at org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:427)
    	at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:230)
    	at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:220)
    	at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:94)
    	at org.apache.openjpa.lib.rop.EagerResultList.(EagerResultList.java:34)
    	... 11 more
    NestedThrowables:
    org.postgresql.util.PSQLException: ERROR: invalid escape string
      Hint: Escape string must be empty or one character.
    	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)
    	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)
    	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
    	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
    	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
    	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:273)
    	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
    	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
    	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
    	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:286)
    	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1181)
    	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:284)
    	at org.apache.openjpa.jdbc.sql.PostgresDictionary$PostgresPreparedStatement.executeQuery(PostgresDictionary.java:1012)
    	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:284)
    	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1783)
    	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:274)
    	at org.apache.openjpa.jdbc.sql.SelectImpl.executeQuery(SelectImpl.java:499)
    	at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:424)
    	at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:391)
    	at org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:427)
    	at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:230)
    	at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:220)
    	at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:94)
    	at org.apache.openjpa.lib.rop.EagerResultList.(EagerResultList.java:34)
    	at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1251)
    	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1007)
    	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:863)
    	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:794)
    	at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542)
    	at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:315)
    	at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:331)
    	at org.jpab.Test.query(Test.java:315)
    	at org.jpab.Runner$QueryAction.run0(Runner.java:562)
    	at org.jpab.Runner$TestAction.run(Runner.java:517)
    	at java.lang.Thread.run(Thread.java:662)