OpenJPA with PostgreSQL server

Performance Result Summary

The final position of OpenJPA with PostgreSQL server in the speed performance tests is 21 out of 32,

The following charts show OpenJPA with PostgreSQL server relatively to other tested JPA/DBMS combinations.

Position #1 on the X-Axis (the fastest) is about 100 times faster than position #32 (the slowest).
In the chart below the Y-Axis represents result score (maximum 100) in logarithmic scale - higher is better:
JPA performance benchmark comparision Hibernate, EclipseLink, OpenJPA, DataNucleus, ObjectDB
In the chart below the Y-Axis represents result score (maximum 100) in linear scale - higher is better:
JPA performance benchmark comparision Hibernate, EclipseLink, OpenJPA, DataNucleus, ObjectDB

OpenJPA with PostgreSQL server Problems (Exceptions)

OpenJPA with PostgreSQL server has failed in the following tests (throwing the following stack traces):

  • Graph (Binary Tree) Test - Retrieval Operations - Many Entities (5000)
     org.apache.openjpa.persistence.RollbackException: The transaction has been rolled back.  See the nested exceptions for details on the errors that occurred.
    FailedObject: org.jpab.node.Node@3a0ab1
    	at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:583)
    	at org.jpab.Test.persist(Test.java:216)
    	at org.jpab.Test.persist(Test.java:199)
    	at org.jpab.Runner$PersistAction.run0(Runner.java:530)
    	at org.jpab.Runner$TestAction.run(Runner.java:509)
    	at java.lang.Thread.run(Thread.java:619)
    Caused by:  org.apache.openjpa.persistence.PersistenceException: The transaction has been rolled back.  See the nested exceptions for details on the errors that occurred.
    FailedObject: org.jpab.node.Node@3a0ab1
    	at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2302)
    	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2139)
    	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2037)
    	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1955)
    	at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
    	at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1479)
    	at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:925)
    	at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:559)
    	... 5 more
    Caused by:  org.apache.openjpa.persistence.PersistenceException: ERROR: duplicate key value violates unique constraint "node_pkey" {prepstmnt 25150543 INSERT INTO Node (id, changeCount, CHILD1_ID, CHILD2_ID) VALUES (?, ?, ?, ?) [params=(int) 110001, (int) 0, (int) 110002, (int) 110003]} [code=0, state=23505]
    FailedObject: org.jpab.node.Node@3a0ab1
    	at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4821)
    	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4787)
    	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136)
    	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:78)
    	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:143)
    	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:81)
    	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:99)
    	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:87)
    	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:550)
    	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:106)
    	at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:59)
    	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:103)
    	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:76)
    	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:751)
    	at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:131)
    	... 12 more
    Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ERROR: duplicate key value violates unique constraint "node_pkey" {prepstmnt 25150543 INSERT INTO Node (id, changeCount, CHILD1_ID, CHILD2_ID) VALUES (?, ?, ?, ?) [params=(int) 110001, (int) 0, (int) 110002, (int) 110003]} [code=0, state=23505]
    	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:257)
    	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:233)
    	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$1000(LoggingConnectionDecorator.java:70)
    	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:1079)
    	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:285)
    	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:285)
    	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1722)
    	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:267)
    	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:118)
    	... 22 more
    
  • Graph (Binary Tree) Test - Update Operations - Many Entities (5000)
     org.apache.openjpa.persistence.RollbackException: The transaction has been rolled back.  See the nested exceptions for details on the errors that occurred.
    FailedObject: org.jpab.node.Node@3a0ab1
    	at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:583)
    	at org.jpab.Test.persist(Test.java:216)
    	at org.jpab.Test.persist(Test.java:199)
    	at org.jpab.Runner$PersistAction.run0(Runner.java:530)
    	at org.jpab.Runner$TestAction.run(Runner.java:509)
    	at java.lang.Thread.run(Thread.java:619)
    Caused by:  org.apache.openjpa.persistence.PersistenceException: The transaction has been rolled back.  See the nested exceptions for details on the errors that occurred.
    FailedObject: org.jpab.node.Node@3a0ab1
    	at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2302)
    	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2139)
    	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2037)
    	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1955)
    	at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
    	at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1479)
    	at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:925)
    	at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:559)
    	... 5 more
    Caused by:  org.apache.openjpa.persistence.PersistenceException: ERROR: duplicate key value violates unique constraint "node_pkey" {prepstmnt 25150543 INSERT INTO Node (id, changeCount, CHILD1_ID, CHILD2_ID) VALUES (?, ?, ?, ?) [params=(int) 110001, (int) 0, (int) 110002, (int) 110003]} [code=0, state=23505]
    FailedObject: org.jpab.node.Node@3a0ab1
    	at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4821)
    	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4787)
    	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136)
    	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:78)
    	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:143)
    	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:81)
    	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:99)
    	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:87)
    	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:550)
    	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:106)
    	at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:59)
    	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:103)
    	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:76)
    	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:751)
    	at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:131)
    	... 12 more
    Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ERROR: duplicate key value violates unique constraint "node_pkey" {prepstmnt 25150543 INSERT INTO Node (id, changeCount, CHILD1_ID, CHILD2_ID) VALUES (?, ?, ?, ?) [params=(int) 110001, (int) 0, (int) 110002, (int) 110003]} [code=0, state=23505]
    	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:257)
    	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:233)
    	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$1000(LoggingConnectionDecorator.java:70)
    	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:1079)
    	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:285)
    	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:285)
    	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1722)
    	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:267)
    	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:118)
    	... 22 more
    
  • Graph (Binary Tree) Test - Removal Operations - Many Entities (5000)
     org.apache.openjpa.persistence.RollbackException: The transaction has been rolled back.  See the nested exceptions for details on the errors that occurred.
    FailedObject: org.jpab.node.Node@3a0ab1
    	at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:583)
    	at org.jpab.Test.persist(Test.java:216)
    	at org.jpab.Test.persist(Test.java:199)
    	at org.jpab.Runner$PersistAction.run0(Runner.java:530)
    	at org.jpab.Runner$TestAction.run(Runner.java:509)
    	at java.lang.Thread.run(Thread.java:619)
    Caused by:  org.apache.openjpa.persistence.PersistenceException: The transaction has been rolled back.  See the nested exceptions for details on the errors that occurred.
    FailedObject: org.jpab.node.Node@3a0ab1
    	at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2302)
    	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2139)
    	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2037)
    	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1955)
    	at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
    	at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1479)
    	at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:925)
    	at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:559)
    	... 5 more
    Caused by:  org.apache.openjpa.persistence.PersistenceException: ERROR: duplicate key value violates unique constraint "node_pkey" {prepstmnt 25150543 INSERT INTO Node (id, changeCount, CHILD1_ID, CHILD2_ID) VALUES (?, ?, ?, ?) [params=(int) 110001, (int) 0, (int) 110002, (int) 110003]} [code=0, state=23505]
    FailedObject: org.jpab.node.Node@3a0ab1
    	at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4821)
    	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4787)
    	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136)
    	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:78)
    	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:143)
    	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:81)
    	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:99)
    	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:87)
    	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:550)
    	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:106)
    	at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:59)
    	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:103)
    	at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:76)
    	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:751)
    	at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:131)
    	... 12 more
    Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ERROR: duplicate key value violates unique constraint "node_pkey" {prepstmnt 25150543 INSERT INTO Node (id, changeCount, CHILD1_ID, CHILD2_ID) VALUES (?, ?, ?, ?) [params=(int) 110001, (int) 0, (int) 110002, (int) 110003]} [code=0, state=23505]
    	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:257)
    	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:233)
    	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$1000(LoggingConnectionDecorator.java:70)
    	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:1079)
    	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:285)
    	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:285)
    	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1722)
    	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:267)
    	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:118)
    	... 22 more
    
  • Multithreading Test - Query Operations - Few Entities (5/100)
     org.apache.openjpa.persistence.ArgumentException: Failed to execute query "SELECT o FROM Person o WHERE o.lastName LIKE :pattern". Check the query syntax for correctness. See nested exception for details.
    	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:870)
    	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:792)
    	at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542)
    	at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:288)
    	at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:302)
    	at org.jpab.Test.query(Test.java:314)
    	at org.jpab.Runner$QueryAction.run0(Runner.java:552)
    	at org.jpab.Runner$TestAction.run(Runner.java:507)
    	at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
    	at org.apache.openjpa.jdbc.kernel.PreparedSQLStoreQuery$PreparedSQLExecutor.toParameterArray(PreparedSQLStoreQuery.java:157)
    	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:855)
    	... 8 more
    
  • Multithreading Test - Query Operations - Many Entities (5000)
     org.apache.openjpa.persistence.ArgumentException: Failed to execute query "SELECT o FROM Person o WHERE o.lastName LIKE :pattern". Check the query syntax for correctness. See nested exception for details.
    	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:870)
    	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:792)
    	at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542)
    	at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:288)
    	at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:302)
    	at org.jpab.Test.query(Test.java:314)
    	at org.jpab.Runner$QueryAction.run0(Runner.java:552)
    	at org.jpab.Runner$TestAction.run(Runner.java:507)
    	at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
    	at org.apache.openjpa.jdbc.kernel.PreparedSQLStoreQuery$PreparedSQLExecutor.toParameterArray(PreparedSQLStoreQuery.java:157)
    	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:855)
    	... 8 more
    

The following runs have been stopped due to being too slow

  • Graph (Binary Tree) Test - Retrieval Operations - Few Entities (5/100)
  • Graph (Binary Tree) Test - Update Operations - Few Entities (5/100)
  • Graph (Binary Tree) Test - Removal Operations - Few Entities (5/100)

OpenJPA with PostgreSQL server compared to the alternatives

See head to head comparisons of OpenJPA with PostgreSQL server vs the following compatitors: