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 persistence 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 |
---|---|---|---|---|---|---|---|---|---|---|---|
DataNucleus | 6,448 | 13,833 | 16,611 | failed | 6,562 | 8,503 | 4,866 | 16,161 | |||
EclipseLink | 8,008 | 22,309 | 22,355 | 4,170 | 7,707 | 7,876 | 4,705 | 28,325 | |||
Hibernate | 7,324 | 22,468 | 25,365 | failed | 7,567 | 9,720 | 5,729 | 27,102 | |||
OpenJPA | 6,504 | 19,937 | 13,719 | 7,468 | 8,140 | 5,193 | 17,795 | ||||
ObjectDB | 195,608 | 194,390 |
Performance comparison chart - The Y-Axis represents normalized score in logarithmic scale - higher is better:
Performance comparison chart - The Y-Axis represents normalized score in linear scale - higher is better:
Best and Worst JPA/Database Performer in this comparison
The Most Efficient (the Fastest):
1. | ObjectDB embedded | 100 |
2. | ObjectDB server | 99.4 |
3. | EclipseLink with PostgreSQL server | 14.5 |
4. | Hibernate with PostgreSQL server | 13.9 |
5. | Hibernate with HSQLDB embedded | 13.0 |
6. | Hibernate with H2 embedded | 11.5 |
7. | EclipseLink with HSQLDB embedded | 11.4 |
8. | EclipseLink with H2 embedded | 11.4 |
9. | OpenJPA with H2 embedded | 10.2 |
10. | OpenJPA with PostgreSQL server | 9.1 |
11. | DataNucleus with HSQLDB embedded | 8.5 |
12. | DataNucleus with PostgreSQL server | 8.3 |
13. | DataNucleus with H2 embedded | 7.1 |
14. | OpenJPA with HSQLDB embedded | 7.0 |
15. | Hibernate with H2 server | 5.0 |
16. | DataNucleus with H2 server | 4.3 |
17. | OpenJPA with H2 server | 4.2 |
The Least Efficient (the Slowest):
18. | EclipseLink with Derby embedded | 4.1 |
19. | EclipseLink with H2 server | 4.0 |
20. | EclipseLink with Derby server | 3.9 |
21. | Hibernate with Derby server | 3.9 |
22. | OpenJPA with Derby server | 3.8 |
23. | Hibernate with Derby embedded | 3.7 |
24. | DataNucleus with Derby server | 3.4 |
25. | OpenJPA with Derby embedded | 3.3 |
26. | DataNucleus with Derby embedded | 3.3 |
27. | Hibernate with MySQL server | 2.9 |
28. | OpenJPA with MySQL server | 2.7 |
29. | DataNucleus with MySQL server | 2.5 |
30. | EclipseLink with MySQL server | 2.4 |
31. | EclipseLink with SQLite embedded | 2.1 |
32. | DataNucleus with DB4O embedded | 0.0000 |
33. | Hibernate with SQLite embedded | 0.0000 |
Problems (Exceptions) in these tests
- Hibernate with SQLite embedded
javax.persistence.RollbackException: Error while committing the transaction at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:93) at org.jpab.Test.persist(Test.java:217) at org.jpab.Test.persist(Test.java:200) at org.jpab.Runner$PersistAction.run0(Runner.java:538) at org.jpab.Runner$TestAction.run(Runner.java:517) at java.lang.Thread.run(Thread.java:662) Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not insert: [org.jpab.basic.Person] at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1214) at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1147) at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:81) ... 5 more Caused by: org.hibernate.exception.GenericJDBCException: could not insert: [org.jpab.basic.Person] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2436) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2856) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:383) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:133) at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:76) ... 5 more Caused by: java.sql.SQLException: PRIMARY KEY must be unique at org.sqlite.DB.throwex(DB.java:288) at org.sqlite.DB.executeBatch(DB.java:236) at org.sqlite.PrepStmt.executeBatch(PrepStmt.java:82) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70) at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:56) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2416) ... 16 more
- DataNucleus with DB4O embedded
javax.persistence.PersistenceException: Object "org.jpab.basic.Person@7d6b4be5" being inserted has id "13" yet an object with this id already exists in the datastore! at org.datanucleus.api.jpa.NucleusJPAHelper.getJPAExceptionForNucleusException(NucleusJPAHelper.java:302) at org.datanucleus.api.jpa.JPAEntityTransaction.commit(JPAEntityTransaction.java:122) at org.jpab.Test.persist(Test.java:217) at org.jpab.Test.persist(Test.java:200) at org.jpab.Runner$PersistAction.run0(Runner.java:538) at org.jpab.Runner$TestAction.run(Runner.java:517) at java.lang.Thread.run(Thread.java:662) Caused by: org.datanucleus.exceptions.NucleusUserException: Object "org.jpab.basic.Person@7d6b4be5" being inserted has id "13" yet an object with this id already exists in the datastore! at org.datanucleus.store.db4o.DB4OPersistenceHandler.insertObject(DB4OPersistenceHandler.java:140) at org.datanucleus.state.JDOStateManager.internalMakePersistent(JDOStateManager.java:2371) at org.datanucleus.state.JDOStateManager.flush(JDOStateManager.java:3803) at org.datanucleus.ObjectManagerImpl.flushInternalWithOrdering(ObjectManagerImpl.java:3832) at org.datanucleus.ObjectManagerImpl.flushInternal(ObjectManagerImpl.java:3755) at org.datanucleus.ObjectManagerImpl.flush(ObjectManagerImpl.java:3701) at org.datanucleus.ObjectManagerImpl.preCommit(ObjectManagerImpl.java:4084) at org.datanucleus.ObjectManagerImpl$2.transactionPreCommit(ObjectManagerImpl.java:398) at org.datanucleus.TransactionImpl.internalPreCommit(TransactionImpl.java:370) at org.datanucleus.TransactionImpl.commit(TransactionImpl.java:259) at org.datanucleus.api.jpa.JPAEntityTransaction.commit(JPAEntityTransaction.java:103) ... 5 more
The results above are in use in calculating the following average results
- All Tests - All Operations - All Batch Size Modes
- All Tests - All Operations - Many Entities (5000)
- All Tests - Persistence Operations - All Batch Size Modes
- All Tests - Persistence Operations - Many Entities (5000)
- Multithreading Test - All Operations - All Batch Size Modes
- Multithreading Test - All Operations - Many Entities (5000)
- Multithreading Test - Persistence Operations - All Batch Size Modes