Apache Derby - a Pure Java Database
Derby Performance Summary
The following charts show the performance of Derby (in green) relatively to other JPA/DBMS combinations (in gray).
Position #1 on the X-Axis (the fastest) is about 100 times faster than position #33 (the slowest).
The configurations in which Derby has been tested are listed in the following table:
Database + JPA Provider | Normalized Score 100 - Best, 0 - Worst | Final Position 1 - Best, 33 - Worst | Failed Tests | |
---|---|---|---|---|
1 | EclipseLink with Derby embedded | 13.6 | 6 (out of 33) | 0 |
2 | Hibernate with Derby embedded | 8.3 | 12 (out of 33) | 0 |
3 | OpenJPA with Derby embedded | 7.4 | 14 (out of 33) | 0 |
4 | DataNucleus with Derby embedded | 6.9 | 16 (out of 33) | 6 |
5 | EclipseLink with Derby server | 6.6 | 17 (out of 33) | 0 |
6 | Hibernate with Derby server | 5.6 | 20 (out of 33) | 0 |
7 | OpenJPA with Derby server | 4.2 | 22 (out of 33) | 0 |
8 | DataNucleus with Derby server | 3.3 | 24 (out of 33) | 6 |
As shown above, the performance and stability are highly dependent on the JPA provider.
Derby is faster and more stable
(in both client-server and embedded modes) when used with EclipseLink or Hibernate.
In addition, analysis of the results reveals that Derby is fast mainly in retrieval and
queries but it is relatively slow in insert/update/delete operations.
About Apache Derby
Derby is a popular pure Java RDBMS, developed by the Apache Software Foundation.
The first version was released in 1997 by Cloudscape. First it was called JBMS and later it was renamed to Cloudscape. Cloudscape was acquired by Informix in 1999 and then by IBM (with the Informix database) in 2001. The Cloudscape database code has been contributed by IBM to Apache in 2004. Derby is also packaged by Sun in JDK 6 under the name Java DB.
Derby is available under the Apache open source license.
In this benchmark Apache Derby version 10.8.2.2 (which was released in October 2011) has been tested.
Both client-server and embedded mode are supported by Derby and were tested in this benchmark.
Solved Problems and Issues
The stack traces below demonstrate some exceptions that have been thrown when using Derby in previous runs of this benchmark and have been fixed by upgrading software and setting.
org.apache.openjpa.persistence.RollbackException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'SQL100909081912210' defined on 'OPENJPA_SEQUENCES_TABLE'. {prepstmnt 24401596 INSERT INTO OPENJPA_SEQUENCES_TABLE (ID, SEQUENCE_VALUE) VALUES (?, ?) [params=(String) DEFAULT, (int) 0]} [code=30000, state=23505] 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:528) at org.jpab.Runner$TestAction.run(Runner.java:507) at java.lang.Thread.run(Thread.java:619) Caused by: org.apache.openjpa.persistence.EntityExistsException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'SQL100909081912210' defined on 'OPENJPA_SEQUENCES_TABLE'. {prepstmnt 24401596 INSERT INTO OPENJPA_SEQUENCES_TABLE (ID, SEQUENCE_VALUE) VALUES (?, ?) [params=(String) DEFAULT, (int) 0]} [code=30000, state=23505] at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4812) 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:110) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:62) at org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:66) at org.apache.openjpa.util.ImplHelper.generateValue(ImplHelper.java:160) at org.apache.openjpa.util.ImplHelper.generateFieldValue(ImplHelper.java:144) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignField(JDBCStoreManager.java:794) at org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:487) at org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:463) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStoreManager.java:778) at org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(DelegatingStoreManager.java:135) at org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:605) at org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2952) at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:40) at org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:1047) at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2077) 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.lib.jdbc.ReportingSQLException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'SQL100909081912210' defined on 'OPENJPA_SEQUENCES_TABLE'. {prepstmnt 24401596 INSERT INTO OPENJPA_SEQUENCES_TABLE (ID, SEQUENCE_VALUE) VALUES (?, ?) [params=(String) DEFAULT, (int) 0]} [code=30000, 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.jdbc.kernel.TableJDBCSeq.executeUpdate(TableJDBCSeq.java:816) at org.apache.openjpa.jdbc.kernel.TableJDBCSeq.insertSequence(TableJDBCSeq.java:501) at org.apache.openjpa.jdbc.kernel.TableJDBCSeq.access$100(TableJDBCSeq.java:74) at org.apache.openjpa.jdbc.kernel.TableJDBCSeq$AllocateSequenceRunnable.run(TableJDBCSeq.java:902) at org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:454) at org.apache.openjpa.jdbc.kernel.TableJDBCSeq.nextInternal(TableJDBCSeq.java:305) at org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:60) ... 23 more
org.apache.openjpa.persistence.RollbackException: java.net.BindException : Error connecting to server localhost on port 1527 with message Address already in use: connect. 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:528) at org.jpab.Runner$TestAction.run(Runner.java:507) at java.lang.Thread.run(Thread.java:619) Caused by: org.apache.openjpa.persistence.PersistenceException: java.net.BindException : Error connecting to server localhost on port 1527 with message Address already in use: connect. at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4827) 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:110) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:62) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:987) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.retainConnection(JDBCStoreManager.java:272) at org.apache.openjpa.kernel.DelegatingStoreManager.retainConnection(DelegatingStoreManager.java:164) at org.apache.openjpa.kernel.BrokerImpl.retainConnection(BrokerImpl.java:3914) at org.apache.openjpa.kernel.BrokerImpl.beginStoreManagerTransaction(BrokerImpl.java:1395) at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2097) 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: java.sql.SQLNonTransientConnectionException: java.net.BindException : Error connecting to server localhost on port 1527 with message Address already in use: connect. at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source) at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source) at org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getConnection(SimpleDriverDataSource.java:96) at org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getConnection(SimpleDriverDataSource.java:91) at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:139) at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:112) at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:139) at org.apache.openjpa.jdbc.schema.DataSourceFactory$DefaultsDataSource.getConnection(DataSourceFactory.java:325) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connectInternal(JDBCStoreManager.java:998) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:983) ... 16 more Caused by: org.apache.derby.client.am.DisconnectException: java.net.BindException : Error connecting to server localhost on port 1527 with message Address already in use: connect. at org.apache.derby.client.net.NetAgent.(Unknown Source) at org.apache.derby.client.net.NetConnection.newAgent_(Unknown Source) at org.apache.derby.client.am.Connection.(Unknown Source) at org.apache.derby.client.net.NetConnection.(Unknown Source) at org.apache.derby.client.net.NetConnection40.(Unknown Source) at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown Source) ... 25 more Caused by: java.net.BindException: Address already in use: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:519) at java.net.Socket.connect(Socket.java:469) at java.net.Socket.(Socket.java:366) at java.net.Socket.(Socket.java:180) at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:196) at org.apache.derby.client.net.OpenSocketAction.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) ... 31 more
org.apache.openjpa.persistence.PersistenceException: There were errors initializing your configuration: org.apache.openjpa.util.UserException: A connection could not be obtained for driver class "org.apache.derby.jdbc.ClientDriver" and URL "jdbc:derby://localhost:1527/jpb/jpab4080130527;create=true". You may have specified an invalid URL. at org.apache.openjpa.jdbc.schema.DataSourceFactory.newConnectException(DataSourceFactory.java:261) at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:247) at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(JDBCConfigurationImpl.java:725) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.openjpa.lib.conf.ConfigurationImpl.instantiateAll(ConfigurationImpl.java:294) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll(OpenJPAConfigurationImpl.java:1602) at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:634) at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:193) at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:213) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:151) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:57) at org.jpab.Runner.handleAction(Runner.java:292) at org.jpab.Runner.run(Runner.java:249) at org.jpab.Runner.main(Runner.java:78) Caused by: java.sql.SQLNonTransientConnectionException: java.net.BindException : Error connecting to server localhost on port 1527 with message Address already in use: connect. at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source) at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source) at org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getConnection(SimpleDriverDataSource.java:96) at org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getConnection(SimpleDriverDataSource.java:91) at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:139) at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:112) at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:239) ... 16 more Caused by: org.apache.derby.client.am.DisconnectException: java.net.BindException : Error connecting to server localhost on port 1527 with message Address already in use: connect. at org.apache.derby.client.net.NetAgent.(Unknown Source) at org.apache.derby.client.net.NetConnection.newAgent_(Unknown Source) at org.apache.derby.client.am.Connection.(Unknown Source) at org.apache.derby.client.net.NetConnection.(Unknown Source) at org.apache.derby.client.net.NetConnection40.(Unknown Source) at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown Source) ... 22 more Caused by: java.net.BindException: Address already in use: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:519) at java.net.Socket.connect(Socket.java:469) at java.net.Socket.(Socket.java:366) at java.net.Socket.(Socket.java:180) at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:196) at org.apache.derby.client.net.OpenSocketAction.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) ... 28 more at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:208) at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:213) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:151) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:57) at org.jpab.Runner.handleAction(Runner.java:292) at org.jpab.Runner.run(Runner.java:249) at org.jpab.Runner.main(Runner.java:78) Caused by: java.lang.RuntimeException: There were errors initializing your configuration: org.apache.openjpa.util.UserException: A connection could not be obtained for driver class "org.apache.derby.jdbc.ClientDriver" and URL "jdbc:derby://localhost:1527/jpb/jpab4080130527;create=true". You may have specified an invalid URL. at org.apache.openjpa.jdbc.schema.DataSourceFactory.newConnectException(DataSourceFactory.java:261) at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:247) at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(JDBCConfigurationImpl.java:725) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.openjpa.lib.conf.ConfigurationImpl.instantiateAll(ConfigurationImpl.java:294) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll(OpenJPAConfigurationImpl.java:1602) at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:634) at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:193) at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:213) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:151) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:57) at org.jpab.Runner.handleAction(Runner.java:292) at org.jpab.Runner.run(Runner.java:249) at org.jpab.Runner.main(Runner.java:78) Caused by: java.sql.SQLNonTransientConnectionException: java.net.BindException : Error connecting to server localhost on port 1527 with message Address already in use: connect. at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source) at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source) at org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getConnection(SimpleDriverDataSource.java:96) at org.apache.openjpa.jdbc.schema.SimpleDriverDataSource.getConnection(SimpleDriverDataSource.java:91) at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:139) at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:112) at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:239) ... 16 more Caused by: org.apache.derby.client.am.DisconnectException: java.net.BindException : Error connecting to server localhost on port 1527 with message Address already in use: connect. at org.apache.derby.client.net.NetAgent.(Unknown Source) at org.apache.derby.client.net.NetConnection.newAgent_(Unknown Source) at org.apache.derby.client.am.Connection.(Unknown Source) at org.apache.derby.client.net.NetConnection.(Unknown Source) at org.apache.derby.client.net.NetConnection40.(Unknown Source) at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown Source) ... 22 more Caused by: java.net.BindException: Address already in use: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:519) at java.net.Socket.connect(Socket.java:469) at java.net.Socket.(Socket.java:366) at java.net.Socket.(Socket.java:180) at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:196) at org.apache.derby.client.net.OpenSocketAction.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) ... 28 more at org.apache.openjpa.lib.conf.ConfigurationImpl.instantiateAll(ConfigurationImpl.java:308) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll(OpenJPAConfigurationImpl.java:1602) at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:634) at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:193) ... 7 more
javax.persistence.RollbackException: Transaction failed to commit at org.datanucleus.jpa.EntityTransactionImpl.commit(EntityTransactionImpl.java:120) at org.jpab.Test.persist(Test.java:217) at org.jpab.Test.persist(Test.java:200) at org.jpab.Runner$PersistAction.run0(Runner.java:529) at org.jpab.Runner$TestAction.run(Runner.java:508) at java.lang.Thread.run(Thread.java:619) Caused by: javax.persistence.PersistenceException: Error(s) were found while auto-creating/validating the datastore for classes. The errors are printed in the log, and are attached to this exception. at org.datanucleus.jpa.NucleusJPAHelper.getJPAExceptionForNucleusException(NucleusJPAHelper.java:244) at org.datanucleus.jpa.EntityTransactionImpl.commit(EntityTransactionImpl.java:118) ... 5 more Caused by: java.sql.SQLSyntaxErrorException: In an ALTER TABLE statement, the column 'LOGINCOUNT' has been specified as NOT NULL and either the DEFAULT clause was not specified or was specified as DEFAULT NULL. at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:261) at org.datanucleus.store.rdbms.table.AbstractTable.executeDdlStatement(AbstractTable.java:730) at org.datanucleus.store.rdbms.table.AbstractTable.executeDdlStatementList(AbstractTable.java:681) at org.datanucleus.store.rdbms.table.TableImpl.validateColumns(TableImpl.java:263) at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.performTablesValidation(RDBMSStoreManager.java:2745) at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTablesAndValidate(RDBMSStoreManager.java:2546) at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2191) at org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:113) at org.datanucleus.store.rdbms.RDBMSStoreManager.addClasses(RDBMSStoreManager.java:966) at org.datanucleus.store.AbstractStoreManager.addClass(AbstractStoreManager.java:914) at org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass(MappedStoreManager.java:356) at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.insertObject(RDBMSPersistenceHandler.java:113) at org.datanucleus.jdo.state.JDOStateManagerImpl.internalMakePersistent(JDOStateManagerImpl.java:3273) at org.datanucleus.jdo.state.JDOStateManagerImpl.flush(JDOStateManagerImpl.java:4664) at org.datanucleus.ObjectManagerImpl.flushInternal(ObjectManagerImpl.java:3156) at org.datanucleus.ObjectManagerImpl.flush(ObjectManagerImpl.java:3096) at org.datanucleus.ObjectManagerImpl.preCommit(ObjectManagerImpl.java:3235) at org.datanucleus.ObjectManagerImpl$2.transactionPreCommit(ObjectManagerImpl.java:316) at org.datanucleus.TransactionImpl.internalPreCommit(TransactionImpl.java:394) at org.datanucleus.TransactionImpl.commit(TransactionImpl.java:279) at org.datanucleus.jpa.EntityTransactionImpl.commit(EntityTransactionImpl.java:106) ... 5 more Caused by: java.sql.SQLException: In an ALTER TABLE statement, the column 'LOGINCOUNT' has been specified as NOT NULL and either the DEFAULT clause was not specified or was specified as DEFAULT NULL. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source) ... 34 more Caused by: ERROR 42601: In an ALTER TABLE statement, the column 'LOGINCOUNT' has been specified as NOT NULL and either the DEFAULT clause was not specified or was specified as DEFAULT NULL. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.sql.compile.ColumnDefinitionNode.bindAndValidateDefault(Unknown Source) at org.apache.derby.impl.sql.compile.TableElementList.validate(Unknown Source) at org.apache.derby.impl.sql.compile.AlterTableNode.bindStatement(Unknown Source) at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source) at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source) at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source) ... 28 more
javax.persistence.RollbackException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.1.v20100817-r8050): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.BatchUpdateException: DELETE on table 'NODE' caused a violation of foreign key constraint 'FK_NODE_CHILD2_ID' for key (130029). The statement has been rolled back. Error Code: 20000 at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:102) at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63) at org.jpab.Test.doAction(Test.java:272) at org.jpab.Runner$RemoveAction.run0(Runner.java:578) at org.jpab.Runner$TestAction.run(Runner.java:508) at java.lang.Thread.run(Thread.java:619) Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.1.v20100817-r8050): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.BatchUpdateException: DELETE on table 'NODE' caused a violation of foreign key constraint 'FK_NODE_CHILD2_ID' for key (130029). The statement has been rolled back. Error Code: 20000 at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeJDK12BatchStatement(DatabaseAccessor.java:830) at org.eclipse.persistence.internal.databaseaccess.ParameterizedSQLBatchWritingMechanism.executeBatchedStatements(ParameterizedSQLBatchWritingMechanism.java:139) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.writesCompleted(DatabaseAccessor.java:1632) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.commitTransaction(DatabaseAccessor.java:399) at org.eclipse.persistence.internal.sessions.AbstractSession.basicCommitTransaction(AbstractSession.java:504) at org.eclipse.persistence.sessions.server.ClientSession.basicCommitTransaction(ClientSession.java:155) at org.eclipse.persistence.internal.sessions.AbstractSession.commitTransaction(AbstractSession.java:686) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitTransaction(UnitOfWorkImpl.java:1581) at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitTransaction(RepeatableWriteUnitOfWork.java:559) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitTransactionAfterWriteChanges(UnitOfWorkImpl.java:1604) at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:207) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1148) at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:84) ... 5 more Caused by: java.sql.BatchUpdateException: DELETE on table 'NODE' caused a violation of foreign key constraint 'FK_NODE_CHILD2_ID' for key (130029). The statement has been rolled back. at org.apache.derby.impl.jdbc.EmbedStatement.executeBatch(Unknown Source) at org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.executeBatch(DatabasePlatform.java:1964) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeJDK12BatchStatement(DatabaseAccessor.java:817) ... 17 more Caused by: java.sql.SQLIntegrityConstraintViolationException: DELETE on table 'NODE' caused a violation of foreign key constraint 'FK_NODE_CHILD2_ID' for key (130029). The statement has been rolled back. at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeBatchElement(Unknown Source) ... 20 more Caused by: java.sql.SQLException: DELETE on table 'NODE' caused a violation of foreign key constraint 'FK_NODE_CHILD2_ID' for key (130029). The statement has been rolled back. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source) ... 28 more Caused by: ERROR 23503: DELETE on table 'NODE' caused a violation of foreign key constraint 'FK_NODE_CHILD2_ID' for key (130029). The statement has been rolled back. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.sql.execute.ReferencedKeyRIChecker.doCheck(Unknown Source) at org.apache.derby.impl.sql.execute.RISetChecker.doPKCheck(Unknown Source) at org.apache.derby.impl.sql.execute.DeleteResultSet.runFkChecker(Unknown Source) at org.apache.derby.impl.sql.execute.DeleteResultSet.open(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) ... 22 more